iOS 视图之间跳转有两种模式。
- navigationController
- self
navigationController 跳转
- 主视图需要绑定在一个navigationController 控制器上。
- 在跳转到子视图的时候,需要调用主视图的
[self.navigationController pushViewController:secondViewController animated:YES];
3.通过上述方式跳转到的视图控制器 secondViewController 会在视图的顶部都一个 navigationView 的导航视图。并在此视图的左边有一个 back 的按钮,用来回到主视图。
4.跳转到的视图 secondViewController 的 navigationController 同时也指向了主视图的 navigationController。
5.使用 navigationController 条换的方式,动画效果是 【从右到左】

普通跳转模式
- 从一个视图控制器 AViewController 跳转到视图控制器 BViewController。
- 在 AViewController 内调用
[self presentViewController:BViewControll animated:YES completion:nil];
- 在 BViewController 内不会有一个用于返回 AViewController 的 back 按钮。
- 动画效果是 【从下到上】。

网友评论