UIView 弹出动画

// 展开动画
- (void)beginAnimations
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    [UIView beginAnimations:nil context:context];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:0.6];//动画时间长度,单位秒,浮点数
    myView.frame = CGRectMake(0, 0, 320, 110);
    [UIView commitAnimations];
}

// 收起动画
- (void)endAnimations
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    [UIView beginAnimations:nil context:context];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:0.6];//动画时间长度,单位秒,浮点数
    myView.frame = CGRectMake(0, -110, 320, 110);
    [UIView commitAnimations];
}

 

posted @ 2014-01-13 19:55  菜鸟程序猿  阅读(1318)  评论(0编辑  收藏  举报