zoukankan      html  css  js  c++  java
  • push方法的页面间跳转--

    一,自定义动画写push方法--
    添加coreGraphics.framework框架
    
    在CATransitionAnimation.h文件里面引入--
    #import <QuartzCore/QuartzCore.h>
    @interface CATransitionAnimation : UIViewController
    //用CATransition重写viewControlller的push方法--1
    -(void)customPushViewControllerWithAnimation:(UIViewController *)viewController;
    
    在CATransitionAnimation.m文件里面写方法
    //用CATransition重写viewControlller的push方法--
    -(void)customPushViewControllerWithAnimation:(UIViewController *)viewController{
        CATransition *transition=[CATransition animation];
        transition.duration=0.3f;//控制跳转快慢--
        transition.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];//用淡出淡入的方法
        transition.type=kCATransitionPush;//用push方法
        transition.removedOnCompletion=YES;
        transition.subtype=kCATransitionFromRight;//从右边开始推
        [viewController.view.layer addAnimation:transition forKey:@"transition"];
        [self presentViewController:viewController animated:NO completion:^{}];
         }
    在运用文件里面继承此类--
    @interface ViewController : CATransitionAnimation
    然后直接在文件里面引用此方法--
    
    二,运用navigation框架方法写push方法--
    当上一个页面跳转的本页面时:
    nextPAGEViewcontroller *newpage=[[nextPAGEViewcontroller alloc] init];
    UINavigationController *NAC=[[UINavigationController alloc]initWithRootViewController:newpage];
    NAC.navigationBarHidden=YES;
    
    在下一个页面直接调用navigation跳转方法--
      [self.navigationController pushViewController:viewController animated:YES];


  • 相关阅读:
    Codeforces 235C Cyclical Quest 后缀自动机
    HDU-6583 Typewriter 后缀自动机+dp
    HDU-4436 str2int 后缀自动机
    [题解]诸侯安置(dp+组合)
    [题解]洛谷P1350车的放置
    二进制表示中1的个数与异或关系
    [洛谷P1593][POJ-1845Sumdiv] 因子和
    [USACO08DEC]拍头Patting Heads 题解
    [小白逛公园]|[SP1716]|[UVA1400]解题报告(三合一)
    P2034选择数字题解
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/3217868.html
Copyright © 2011-2022 走看看