我希望我的导航栏使用黑色透明外观。在我的 Non-Storyboard 应用程序中,我可以将此代码放入 AppDidFinishLoadingWithOptions
中:
[[UINavigationBar appearance] setTintColor:[AppColors navBarColor]];
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlackTranslucent];
[[UINavigationBar appearance] setAlpha:0.7];
[[[UITableView appearance] backgroundView]setBackgroundColor:[AppColors tableViewBackgroundColor]];
[[[UITableViewCell appearance] backgroundView]setBackgroundColor:[AppColors tableViewCellBackgroundColor]];
如果我使用 Storyboard,这段代码会去哪里?看来我的 Controller 在应用程序完成启动之前已加载
谢谢!
最佳答案
这将继续与 Storyboard配合使用。 appearance
类方法返回一个代理对象,该对象定义该类的所有已创建实例的样式信息。
关于iPhone iOS5 Storyboard 更改导航栏外观,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8685715/