-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用UINavigationBar appearance无法修改导航栏样式 #12
Comments
直接改 root navigation controller ,然后设置 |
嗯,但是我觉得这样可能用起来并不是很方便,因为App里很有可能会present其他的NavigationController,这样的话就得设置每个NavigationController的样式。UINavigationBar appearance是设置默认样式的,我觉得应该支持一下比较好。 |
如果你用的 storyboard ,只要改个 Class 名 😄 |
我大概找到原因了,是在transferNavigationBarAttributes=YES时,给self.navigationBar设置样式时没有考虑appearance里的值,我改成这样就可以了,不知道代码严不严谨,还望指教: |
那你设置为 NO 试试? |
我试过了,是直接支持的,你要在最开始设置 appearance |
第一个有用,后来 push 的没用,已修复 |
我在AppDelegate里使用UINavigationbar appearance无法修改导航栏的样式:
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:58/255.0 green:58/255.0 blue:58/255.0 alpha:1.0]]; [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; [[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor],NSForegroundColorAttributeName ,[UIFont systemFontOfSize:20.0], NSFontAttributeName, nil]];
没有任何效果
The text was updated successfully, but these errors were encountered: