星空网 > 软件开发 > 操作系统

【代码笔记】自定义导航条颜色

一,效果图。

【代码笔记】自定义导航条颜色images/loading.gif' data-original="http://images2015.cnblogs.com/blog/337518/201510/337518-20151022133638755-1372507710.jpg" width="218" height="400" />

二,工程图。

【代码笔记】自定义导航条颜色

三,代码。

AppDelegate.m

【代码笔记】自定义导航条颜色
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{  self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];  // Override point for customization after application launch.    RootViewController *rootVC=[[RootViewController alloc]init];  UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:rootVC];    // UIBarMetricsDefault:用竖着(拿手机)时UINavigationBar的标准的尺寸来显示UINavigationBar.  //UIBarMetricsLandscapePhone:用横着时UINavigationBar的标准尺寸来显示UINavigationBar  [nav.navigationBar setBackgroundImage:[UIImage imageNamed:@"1.jpg"] forBarMetrics:UIBarMetricsDefault];    self.window.rootViewController=nav;        self.window.backgroundColor = [UIColor whiteColor];  [self.window makeKeyAndVisible];  return YES;}
【代码笔记】自定义导航条颜色

 




原标题:【代码笔记】自定义导航条颜色

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流