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;

  • 相关阅读:
    Charles关于Https SSLHandshake解决备忘录
    图片Image转换为base64编码的方法
    图解HTTP(三)
    图解HTTP(二)
    图解HTTP(一)
    Linux下which、whereis、locate、find命令作用
    jQuery实现图片上传
    常见前端面试题备注
    css实现正方形div的3种方式
    promise
  • 原文地址:https://www.cnblogs.com/cocoajin/p/3145535.html
Copyright © 2011-2022 走看看