我正在尝试设置导航栏后退按钮的颜色和后退按钮的 V 形。
我的应用以导航 Controller 开始。
这个导航 Controller 有一个带有这些行的自定义类:
- (void)awakeFromNib {
[super awakeFromNib];
UIColor *white = [UIColor whiteColor];
[self setTintColor: white];
// [self setBarTintColor: white];
UIFont *fonte = [UIFont fontWithName:@"Avenir-Book" size:14.0f];
NSDictionary *atributos = @{NSForegroundColorAttributeName : white,
NSFontAttributeName : fonte
};
[self setTitleTextAttributes:atributos];
}
该导航 Controller 的 Root View Controller 隐藏了导航栏。这个 Root View Controller 称为主屏幕。
我从那个 View Controller 推送另一个导航栏可见的 View Controller 。该导航栏没有我添加的后退按钮,但 iOS 在那里放置了一个后退按钮和一个 V 形“<主屏幕”。那个按钮和人字形都回来了。
难道这些不是应该遵守使这些项目变白的导航栏类上的设置吗?
怎么了?
最佳答案
要全局设置该颜色,您可以在 AppDelegate 中使用类似这样的东西:
UINavigationBar *navBarAppearance = [UINavigationBar appearance];
[navBarAppearance setTintColor:[UIColor greenColor]];
或者在 Swift 中:
let navBarAppearace = UINavigationBar.appearance()
navBarAppearace.tintColor = UIColor.greenColor()
关于ios - 更改 NavigationBar 人字形和标题颜色无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37643680/