随笔 - 165  文章 - 38  评论 - 85  阅读 - 80万

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];
}
复制代码
posted on   老Zhan  阅读(2923)  评论(0编辑  收藏  举报
< 2012年11月 >
28 29 30 31 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 1
2 3 4 5 6 7 8

点击右上角即可分享
微信分享提示