几种控制器跳转的效果区别

来源:互联网 发布:wifi网络卡怎么办 编辑:程序博客网 时间:2024/06/07 14:25

无导航控制器情况下:

push:报错!只能应用于UINavigationController
show:从底部弹出
modal:从底部弹出
show detail:从底部弹出
present as popover: 从底部弹出
present modally: 从底部弹出
custom: 直接报错

有导航控制器情况下

push:跳转后有导航头,从右侧水平滑出
show: 跳转后有导航头,从右侧水平滑出
modal: 跳转后无上方导航头,从底部弹出
show detail:跳转后无上方导航头,从底部弹出
present as popover: 跳转后无上方导航头,从底部弹出
present modally: 跳转后无上方导航头,从底部弹出
custom: 直接报错

总结:
1.有导航控制器的情况下,viewcontroller才能出右侧滑出
2.push方式的跳转必须有导航控制器支持
3.三种非主流跳转效果相同(show detail,present as popover,present modally),无论有没有导航头都是从底部弹出

另附代码,加深理解~~~
https://github.com/CN-CJ/ViewControllerJumpTypePratice

0 0