纯代码实现布局的UIViewController跳转到带storyboard布局的UIViewController
2015-11-27 18:01
483 查看
需求:需要跳转到用storyboard实现布局的UI ViewController。
实现代码:
实现逻辑是:
1、先通过Storyboard的名字Main来获取到UIStoryboard对象。
2、由于在storyboard中对布局文件与ViewController设置了关联,因此通过storyboard对象及布局文件ID来实例化布局文件对应的UIViewController
实现代码:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; SettingViewController * controller = [storyboard instantiateViewControllerWithIdentifier:@"SettingViewControllerID"]; [self presentViewController:controller animated:YES completion:nil];
实现逻辑是:
1、先通过Storyboard的名字Main来获取到UIStoryboard对象。
2、由于在storyboard中对布局文件与ViewController设置了关联,因此通过storyboard对象及布局文件ID来实例化布局文件对应的UIViewController
相关文章推荐
- uva 1626——Brackets sequence
- 验证组件——FluentValidation
- weka cfsSubsetEvalue.java 中文注释
- 关于UITableView 中两个困惑的问题
- 利用UITextField自定义搜索栏,实现中文输入过程中字母的搜索功能
- Selenium webdriver 学习笔记(三) - 基本UI控件操作
- leetcode之路051 N-Queens
- 23设计模式之建造者模式(Builder)
- Handler, Loop, MessageQueue的工作原理
- 为嵌套在左右滑动的UIScrollview上的UITableView增加滑动删除
- 颜色模型
- Machine Learning week 9 quiz: Anomaly Detection
- HFTP Guide
- HDFS Permissions Guide
- HDFS配额指南(HDFS Quotas Guide)
- Offline Image Viewer Guide
- Offline Edits Viewer Guide
- ViewFs Guide
- 自定义UICollectionViewController只读UICollectionViewLayout
- Android uiautomator(1)-创建工程例子