手写代码往最初的工程添加UINavigationController
来源:互联网 发布:360安全认证软件 编辑:程序博客网 时间:2024/05/21 09:12
每个工程代码都要用到UINavigationController,就是在最初刚开始写代码时,下面是一个以后写代码都可以直接粘贴复制的万能模板,现在特意做成笔记了,以后直接拿来用,不要再反复验证了,太费时间了
1、AppDelegate.h不动
2、AppDelegate.m 添加如下红色代码
#import "AppDelegate.h"
#import "RootViewController.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindowalloc] initWithFrame:[[UIScreenmainScreen] bounds]];
RootViewController *rootViewController = [[RootViewControlleralloc] init];
UINavigationController *navigationController = [[UINavigationControlleralloc] initWithRootViewController:rootViewController];
self.window.rootViewController = navigationController;
self.window.backgroundColor = [UIColorwhiteColor];
[self.windowmakeKeyAndVisible];
return YES;
}
3、新建控制器类RootViewController 继承于UIViewController
1、 RootViewController.h 不动
2、 RootViewController.m 添加以下红色代码
- (void)viewDidLoad
{
[superviewDidLoad];
self.view.backgroundColor = [UIColorredColor];
}
- 手写代码往最初的工程添加UINavigationController
- 最初的最初
- 添加 UINavigationController
- 最初的
- 手写代码的一些经验
- 面试手写代码的题目
- UINavigationController的title添加点击事件
- iOS代码启动的步骤包含UINavigationController
- 手写代码给ScrollView添加约束(Masonry)
- 基于UINavigationController+TabBarController的无xib工程框架
- php手写最基本的代码
- 图片轮播的手写代码
- 手写便利构造器代码的举例?
- 面试常考的三个手写代码
- vc++工程中添加lua代码调用-增加lua的源码到工程
- 往keil的工程里面添加文件
- UINavigationController添加纯色背景
- Spring boot的最初入门新建工程的创建步骤以及错误解析方法
- SpringSide封装Page类
- BoundsChecker安装下载及使用教程攻略
- centos5.6升级php到5.3.8
- android开发步步为营之11:从手机联系人列表获取联系电话
- 今年暑假不AC
- 手写代码往最初的工程添加UINavigationController
- android 二级菜单的实现
- 使用Autolayout xib实现动态高度的TableViewCell
- POJ 3254 Corn Fields DP 状态压缩 入门
- Python-自定义异常
- oracle 存储过程 for (多个循环语句调用)
- HDU 2830 Matrix Swapping II
- 使用GitHub + Hexo搭建个人博客(一)- 安装
- 2015 百度一面