且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS:对View添加动画的常用方法

更新时间:2022-09-16 10:21:53

废话少说,直接上代码:

iOS:对View添加动画的常用方法
-(void) showOrHiddenMenuAndButtomView{
    
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.25];
    //        [UIView setAnimationDelay:0.5];
    [UIView setAnimationDelegate:self];
//    [UIView setAnimationDidStopSelector:@selector(showMenuStop)];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
    
    if (ismenuViewShow) {
        ismenuViewShow = NO;
//        menuView.hidden = YES;
//        butttomView.hidden = YES;
        menuView.frame = CGRectMake(0, -60, 1024, 60);
        butttomView.frame = CGRectMake(0, 748, 1024, 40);
    } else {
        ismenuViewShow = YES;
//        menuView.hidden = NO;
//        butttomView.hidden = NO;
        menuView.frame = CGRectMake(0, 0, 1024, 60);
        butttomView.frame = CGRectMake(0, 708, 1024, 40);
    }
    
    [UIView commitAnimations];
}
iOS:对View添加动画的常用方法
   本文转自老Zhan博客园博客,原文链接:http://www.cnblogs.com/mybkn/archive/2012/11/30/2796796.html,如需转载请自行联系原作者