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];
}
   


作者:老Zhan
出处:http://www.cnblogs.com/mybkn/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

 
原文地址:https://www.cnblogs.com/mybkn/p/2796796.html