zoukankan      html  css  js  c++  java
  • CATransition 动画处理视图切换

    一:引入包和头文件;

            需要在frameworks中添加QuartzCore.framework 

        在接口程序中加上头文件   #import <QuartzCore/QuartzCore.h>

    二:使用

        CATransition *myAnimation = [CATransition animation];
        myAnimation.duration = 0.8f;
        myAnimation.type = kCATransitionPush;
        myAnimation.subtype = kCATransitionFromBottom;
        [self.navigationController.view.layer addAnimation:myAnimation forKey:nil];
        [self.navigationController popViewControllerAnimated:NO];
    

     三:动画类型:

           type:

    Common Transition Types

    These constants specify the transition types that can be used with the type property.

    NSString * const kCATransitionFade;

    NSString * const kCATransitionMoveIn;

    NSString * const kCATransitionPush;

    NSString * const kCATransitionReveal;

       subType:

    Common Transition Subtypes

    These constants specify the direction of motion-based transitions. They are used with the subtype property.

    NSString * const kCATransitionFromRight;

    NSString * const kCATransitionFromLeft;

    NSString * const kCATransitionFromTop;

    NSString * const kCATransitionFromBottom;

  • 相关阅读:
    MPlayer源代码分析
    洛谷 P1025 数的划分
    洛谷 P1209 [USACO1.3]修理牛棚 Barn Repair
    洛谷 P1744 采购特价商品
    洛谷 P1443 马的遍历
    洛谷 P1294 高手去散步
    洛谷 P2104 二进制
    洛谷 P1088 火星人
    洛谷 P1062 数列
    洛谷 P2005 A/B Problem II
  • 原文地址:https://www.cnblogs.com/cocoajin/p/3145535.html
Copyright © 2011-2022 走看看