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;

  • 相关阅读:
    gnuplot
    charles证书安装
    jenkins 配置ssh
    jenkins 配置slave
    centos 安装jenkins
    mac的一些命令
    docker 常用命令
    GO vim环境
    go vendor目录
    protobuf
  • 原文地址:https://www.cnblogs.com/cocoajin/p/3145535.html
Copyright © 2011-2022 走看看