张运涛

c++

   :: 首页 :: 联系 :: 聚合  :: 管理

常用链接

留言簿(4)

搜索

  •  

最新评论

1.使用UIView类函数实现:

  [UIView beginAnimations:@"animationID" context:nil];

  [UIView setAnimationDuration:0.5f];

  [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

       [UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];

         //UIViewAnimationTransitionFlipFromLeft,

    //UIViewAnimationTransitionFlipFromRight,

    //UIViewAnimationTransitionCurlUp,

    //UIViewAnimationTransitionCurlDown,

       //要执行的动作.

       [UIView commitAnimations];


2.使用CATransition对象来实现: //公开的API

    CATransition *animation = [CATransition animation];

    animation.duration = 0.5f;

    animation.timingFunction = UIViewAnimationCurveEaseInOut;

    animation.fillMode = kCAFillModeForwards;


    animation.type = kCATransitionPush;//kCATransitionMoveIn kCATransitionReveal kCATransitionFade

    animation.subtype = kCATransitionFromLeft;//kCATransitionFromRight kCATransitionFromTop  kCATransitionFromBottom

     [self.view.layer addAnimation:animation forKey:@"animation"];

3.2.使用CATransition对象来实现: //末公开的API

    CATransition *animation = [CATransition animation];

    animation.delegate = self;

    animation.duration = 0.5f;

    animation.timingFunction = UIViewAnimationCurveEaseInOut;

    animation.fillMode = kCAFillModeForwards;

    animation.endProgress =1.0;

    animation.removedOnCompletion = NO;


    animation.type = @"cube";

     //@"suckEffect";@"oglFlip";@"rippleEffect";@"pageCurl";@"pageUnCurl";@"cameraIrisHollowOpen";@"cameraIrisHollowClose";


    [self.view.layer addAnimation:animation forKey:@"animation"];


posted on 2010-08-16 11:51 张运涛 阅读(688) 评论(0)  编辑 收藏 引用 所属分类: iphone

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理