您的位置:首页 > 产品设计 > UI/UE

iOS-添加UINavigation

2016-03-23 10:22 357 查看
好久没有用过navigation,现在又要重新用都有很多忘记了。

1.新建的是SingleViewApplication



2.然后呢,在AppDelegate.h中插入ViewController.h头文件



3.在AppDelegate.m中加入代码:



代码如下:

    ViewController *viewController = [[ViewController alloc] init];

    viewController.title = @"hey Girl";

    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];

    navigationController.navigationBar.backgroundColor = [UIColor blueColor];

    [self.window setRootViewController:navigationController];

    [self.window makeKeyAndVisible];

4.得出的效果如图:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: