(1)addsubview方法切换视图
self.view addSubview:(加载的新页面);
相应的 [self.view removeFromSuperview];移除添加的view
(2)self.view
insertSubview:(加载的新页面) atIndex:n;
对n的解释:页面都是层次叠加的,n表示加载到那一层上面
(3)presentModalViewController方法
photoNacController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
photoNacController.modalPresentationStyle = UIModalPresentationFullScreen;
self presentModalViewController:(加载的新页面) animated:
modalTransitionStyle用于设置页面切换的动画
modalPresentationStyle用于设置视图显示的方式
两种方法试试就知道用途了!
(4) pushViewController
导航
[self.navigationController pushViewController:(加载的新页面) animated:YES];
对应的
[self.navigationController popViewControllerAnimated:YES];
总结:系统提供了我们视图切换的方法以及视图切换的默认动画,我们可以选择这几种方法中的去使用,也可以自定义切换的动画animation,我知道的就这些大家有别的欢迎评论我,我重新整理这篇文章