有谁知道,我如何才能使iOS7中的UINavigationBar全黑?默认它是白色的,我需要黑色。IOS7 UINavigationBar黑色背景
-1
A
回答
0
下面是编程创建了一个黑色的UIImage,并将其设置为UINavigationBar的外观的一种方式:
UIView *background = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 568, 44)];
background.backgroundColor = [UIColor blackColor];
UIGraphicsBeginImageContext(background.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[background.layer renderInContext:context];
UIImage *backgroundImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[[UINavigationBar appearance] setBackgroundImage:backgroundImage
forBarMetrics:UIBarMetricsDefault];
0
找到了我自己。进入故事情节,设计师,选择视图控制器,请从属性推断督察,改变上栏“不透明的黑色导航栏”
+0
Interface-Builder不幸的只是提供了一个模拟的外观(查看标签,它说“Simulated Metrics”)。您需要在代码(每个ViewController)或您的info.plist(每个应用程序)中设置它。 – auco
1
如果你的目标只适用于iOS 7,您可以使用:
[[UINavigationBar appearance] setBarTintColor:(UIColor *)];
相关问题
- 1. StatusBar背景黑色,UIAlertView背景黑色,一切都是黑色
- 2. StatusBar iOS7背景颜色
- 3. imagecopy黑色背景
- 4. 背景是黑色
- 5. Subclipse diff变黑色背景
- 6. Visual Studio黑色背景?
- 7. Android:EditText显示黑色背景
- 8. NetBeans,黑色背景主题
- 9. UIView中的黑色背景?
- 10. videojs禁用黑色背景
- 11. imagecopyresampled PNG黑色背景
- 12. Threejs画布背景黑色
- 13. C#WPF gif黑色背景
- 14. css问题背景黑色
- 15. PNG有黑色背景
- 16. dismissModalViewControllerAnimated产生黑色背景
- 17. 文本的黑色背景
- 18. php Imagemagick jpg黑色背景
- 19. CCShaky3D打开背景黑色
- 20. UITabBar删除黑色背景
- 21. itextsharp firefox黑色背景
- 22. Android LinearLayout背景黑色
- 23. MPMoviePlayerController存在黑色背景
- 24. WPF椭圆黑色背景
- 25. 使gvim 7.2背景黑色
- 26. 更改UINavigationBar UISearchController的背景颜色
- 27. 更改UINavigationBar的背景颜色
- 28. 如何从黑色背景更改背景颜色?
- 29. Imagick - 使黑色背景变成白色
- 30. Android - 黑色背景变成灰色
可能复制[如何更改iOS 7中的导航栏颜色?](http://stackoverflow.com/questions/18929864/how-do-i-change-the-navigation-bar-color-in-ios-7 ) – Rajneesh071