ios 调节器 modal 得知
2015-10-17 11:03
399 查看
代码中创建:
1、appdelegate 该contoller放置controller下一个
拿到要跳转的控制器的,然后通过当前的controller 来 调用 presentViewController
调用 dismissViewController方法
在storyBoard创建modal控制器也非常方便。直接ctrl 右键点击 选举moadal状态
1、appdelegate 该contoller放置controller下一个
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window.rootViewController = [[MJOneViewController alloc] init]; [self.window makeKeyAndVisible]; return YES; }2、oneViewController跳转的action
拿到要跳转的控制器的,然后通过当前的controller 来 调用 presentViewController
- (IBAction)jump { // 展示MJTwoViewController MJTwoViewController *two = [[MJTwoViewController alloc] init]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:two]; [self presentViewController:nav animated:YES completion:^{ NSLog(@"展示MJTwoViewController完成......."); }]; }3、twoController 返回之前的controller
调用 dismissViewController方法
- (IBAction)cancel { // NSLog(@"%@", self.view.window.rootViewController); // NSLog(@"%@", self.view.window.subviews); [self dismissViewControllerAnimated:YES completion:^{ NSLog(@"关闭MJTwoViewController...."); }]; // [self.navigationController dismissViewControllerAnimated:YES completion:^{ // NSLog(@"关闭MJTwoViewController...."); // }]; }
在storyBoard创建modal控制器也非常方便。直接ctrl 右键点击 选举moadal状态
相关文章推荐
- IOS中延时执行的几种方式的比较和汇总
- iOS开发见闻-第1期
- iOS本地推送
- 【iOS程序启动与运转】- RunLoop个人小结
- iOS多线程之GCD-NSOperation对比总结
- IOS 中常用站位符
- ios 为什么拖拽的控件为weak 手写的strong
- iOS之改变BarButtonItem中显示的字体大小
- iOS之去掉NavigationBar 底部的黑线
- Quartz2D简介
- iOS_自定义Button
- #在蓝懿学习iOSd的日子#
- 傻瓜式操作Nagios
- iOS开发——Handoff详解
- IOS正则表达式,很详细,值得一看!
- IOS - TableView上拉刷新数据后设置显示偏移(新数据置顶)
- 音乐/音效之工具类的封装
- iOS开发之多线程编程:GCD
- iOS:核心动画之转场动画CATransition
- IOS 同步操作 通信