【发布时间】:2015-12-11 03:00:49
【问题描述】:
我在 AppDelegate.m 中有一个代码,它将所有 UINavigationBar 十六进制颜色设置为 #125687
来自 AppDelegate.m 的代码
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UINavigationBar appearance] setBarTintColor:UIColorFromRGB(0x125687)];
问题是:我在视图控制器中将两个 UINavigationBar 叠放在一起,因此 UINavigationBar 位于状态栏下方。状态栏下方的导航栏位于主导航栏下方。 第二个导航栏的颜色与主导航栏不同。
它是这样的:
(第二个导航栏是颜色比标题为“社区”的导航栏颜色更浅的导航栏)
问题:如何修复它,使两个 UINavigationBar 具有相同的十六进制颜色 (#125687)?
【问题讨论】:
-
我的问题是,当您可以使用直接位于状态栏下方的 64 像素导航栏时,为什么还要使用两个导航栏?
-
@GaneshSomani 无论如何都可以改变导航栏的高度
-
我认为不同颜色的问题是导航栏有一些alpha值。因此,颜色重叠正在发生。有没有碰巧遇到这个问题stackoverflow.com/questions/19105766/…
-
如果您移除状态栏下方的导航栏会怎样?
标签: ios objective-c xcode xcode6 uinavigationbar