Home  >  Article  >  Web Front-end  >  How to implement root controller jump in UIWindow without using proxy (implementation of page jump)_html/css_WEB-ITnose

How to implement root controller jump in UIWindow without using proxy (implementation of page jump)_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:45:07939browse

1. Jump to the page individually

#pragma mark - changeViewController controller jump

- (void)changeViewController{

LoginPageController * login = [[LoginPageController alloc]init];

UIWindow * window = [UIApplication sharedApplication].keyWindow;

window.rootViewController = login;

}

@end

2. The jumped pages include navigation bar (UINavigationController) and UITabBarController

#pragma mark - viewController jump

- (void)changeViewController{

DetailPageController * detailPage = [[DetailPageController alloc]init];

UINavigationController * nv = [[UINavigationController alloc] initWithRootViewController: detailPage];

UITabBarController * tab = [[UITabBarController alloc]init];

tab.viewControllers = @[nv];// Add the navigation bar to the tabbar controller

UIWindow * window = [UIApplication sharedApplication].keyWindow;

window.rootViewController = tab;

}




UIWindow does not use a proxy. How to implement the root controller jump (implementation of page jump) UIWindow does not use a proxy. How to implement the root controller jump (implementation of page jump) UIWindow does not use a proxy. How to implement the jump of the root controller (implementation of page jump) UIWindow without using a proxy How to implement the jump of the root controller (implementation of page jump)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn