【代码笔记】iOS-页面之间的跳转效果

一,工程图。

二,代码。

RootViewController.m

复制代码
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    
    /*
     1,不使用动画
     UIViewAnimationTransitionNone
     
     2,从左向右旋转翻页
     UIViewAnimationTransitionFlipFromLeft
     
     3,从右向左旋转翻页,与UIViewAnimationTransitionFlipFromLeft相反
     UIViewAnimationTransitionFlipFromRight
     
     4,卷曲翻页,从下往上
     UIViewAnimationTransitionCurlUp
     
     5,卷曲翻页,从上往下
     UIViewAnimationTransitionCurlDown
     */

    FirstViewController *firstVC=[[FirstViewController alloc]init];
    
    [UIView  beginAnimations:nil context:NULL];
    //置动画块中的动画属性变化的曲线
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    //设置持续时间
    [UIView setAnimationDuration:0.5];
    //设置过渡的动画效果
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
    
    [self.navigationController pushViewController:firstVC animated:YES];
    //提交动画
    [UIView commitAnimations];

    
}
复制代码

 

 

 
 

转载于:https://www.cnblogs.com/yang-guang-girl/p/5665674.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值