zoukankan      html  css  js  c++  java
  • UI

     1. 从一个视图控制器跳转另一个视图控制器的方式是可以进行设置的

     CATransition *animation = [[CATransition alloc]init];

     animation.duration = 1;

     animation.type = @"pageCurl";  //立方体翻滚效果

     animation.subtype = @"fromBottom";  //从底部开始

    [self.view.window.layer addAnimation:animation forKey:nil];

    //若封装扩展方法,可以直接调用该方法代替上边的 5

     [self.view.superview addTansitionAnimationType:TranstionTypeCube duration:1 direction:TransitionDirectionFromBottom];

     1.1 过渡效果

     fade     //交叉淡化过渡(不支持过渡方向)

     push     //新视图把旧视图推出去

     moveIn   //新视图移到旧视图上面

     reveal   //将旧视图移开,显示下面的新视图

     cube     //立方体翻滚效果

     oglFlip  //上下左右翻转效果

     suckEffect   //收缩效果,如一块布被抽走(不支持过渡方向)

     rippleEffect //滴水效果(不支持过渡方向)

     pageCurl     //向上翻页效果

     pageUnCurl   //向下翻页效果

     cameraIrisHollowOpen  //相机镜头打开效果(不支持过渡方向)

     cameraIrisHollowClose //相机镜头关上效果(不支持过渡方向)

     1.2 翻转方向

     fromLeft   //从左边

     fromRight  //从右边

     fromTop    //从上边

     fromBottom //从底部

     在使用过程中,为使用方便,我们可以对UIView进行类拓展,将使用的翻转效果封装成枚举常量,方便我们快速查找,调用相应的方法即可快速设置

     如调用方法为:

     -(void)addTansitionAnimationType:(TranstionType )type duration:(NSTimeInterval)duration direction:(TransitionDirection )direction;

     类扩展示例:见 --> UIViewAnimation

  • 相关阅读:
    三周#学习进度总结
    四则运算(修改版)
    是否需要有代码规范?
    结对项目:代码复审+PSP
    二周#学习进度总结
    GitHub注册流程(中英对比)
    四则运算:我的设计和设想(未完成版)
    Spring4总结
    Hibernate5总结
    Struts2总结
  • 原文地址:https://www.cnblogs.com/GJ-ios/p/5397740.html
Copyright © 2011-2022 走看看