设置特定的导航栏颜色?

时间:2014-12-11 06:56:19

标签: ios

我正在使用

//declared in viewcontroller.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]

//super view did load
[[UINavigationBar appearance] setBarTintColor:UIColorFromRGB(0x9ff1d1)];

//above view did load
- (void)viewWillAppear:(BOOL)animated {
[self.navigationController setNavigationBarHidden:NO animated:animated];
[super viewWillAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
[self.navigationController setNavigationBarHidden:NO animated:animated];
[super viewWillDisappear:animated];
}

在我的应用中设置导航栏颜色并且有效。更新到iOS 8后,我认为它必须已被弃用。有没有办法将导航栏颜色设置为十六进制颜色:0x9ff1d1)];

0 个答案:

没有答案