视图切换的方式

1、利用NavigationController切换

切换:

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

 返回:

- (UIViewController *)popViewControllerAnimated:(BOOL)animated;

2、覆盖View达到切换效果

切换:

- (void)addSubview:(UIView *)view;

返回:

- (void)removeFromSuperview;

3、利用Present系列方法

切换:

扫描二维码关注公众号,回复: 630701 查看本文章
- (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion NS_AVAILABLE_IOS(5_0);

 返回:

- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^)(void))completion NS_AVAILABLE_IOS(5_0);

以上仅是部分方法,当然还有其它方式!:)

猜你喜欢

转载自wangleyiang.iteye.com/blog/1968378
今日推荐