iOS应用开发中实现页面跳转的简单方法笔记
作为新手写的笔记,方便自己记忆:
从android转过来iOS的,对于页面的跳转,找了很多资料,现在记录一下页面跳转的方法。
1.用navigationController
2.直接跳(刚刚在网上找到的,不太熟,有错莫怪)
1.建一个RootViewController,在delegate.h
@property(strong,nonatomic)UIViewController*viewController; @property(strong,nonatomic)UINavigationController*navController;
delegate.m代码didFinishLaunchingWithOptions函数中写代码:
RootViewController*rootView=[[RootViewControlleralloc]init]; rootView.title=@"RootView"; self.navController=[[UINavigationControlleralloc]init]; [self.navControllerpushViewController:rootViewanimated:YES]; [self.windowaddSubview:self.navController.view];