开发者社区> 问答> 正文

iPhone中下载view视图的问题

(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated

上面的代码实现从左侧下载视图,怎么样从右侧下载视图?

展开
收起
爵霸 2016-05-27 10:38:13 1862 0
1 条回答
写回答
取消 提交回答
  • CATransition *animation = [CATransition animation];
    [[self navigationController] pushViewController:elementController animated:NO];
    [animation setDuration:0.45];
    [animation setType:kCATransitionPush];
    [animation setSubtype:kCATransitionFromLeft];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]];
    [[elementController.view layer] addAnimation:animation forKey:@"SwitchToView1"];

    还需要添加import <QuartzCore/QuartzCore.h>

    2019-07-17 19:17:16
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
A Developer's View 立即下载
Flutter in action 立即下载
《Flutter in action》 立即下载