ten*_*ing 29 transparency objective-c uinavigationbar ios7
是否有任何方法可以使UINavigationBariOS 7的目标成为一种没有半透明效果的纯色?我试过设置backgroundColor,barTintColor,不透明,透明/半透明等等......没有任何效果.
有人知道怎么做吗?
以下是我一直在使用的一些代码块.注意我在上面设置的属性navigationBar.他们都没有,无论以任何顺序或组合都有效.
@property (strong, nonatomic) UITabBarController *tabBarController;
testViewController = [[TestViewController alloc] init];
anotherViewController = [[AnotherViewController alloc] init];
navigationController = [[UINavigationController alloc]
initWithRootViewController:testViewController];
navigationController.navigationBar.barTintColor = [UIColor darkGrayColor;
navigationController.navigationBar.barStyle = UIBarStyleBlack;
navigationController.navigationBar.translucent = YES;
navigationController.navigationBar.opaque = YES;
NSArray *tabBarViewControllers = [NSArray arrayWithObjects:
navigationController,
anotherViewController, nil];
self.tabBarController.viewControllers = tabBarViewControllers;
Run Code Online (Sandbox Code Playgroud)
要使所有导航栏不透明,您只需添加UINavigationBar.appearance().translucent = false即可application:didFinishLaunchingWithOptions:
| 归档时间: |
|
| 查看次数: |
23918 次 |
| 最近记录: |