UIImagePickerControllerSourceTypePhotoLibrary 状态栏纯色/白色
我正在创建一个应用程序,在某种程度上打开照片库。问题是状态栏在照片库中是黑色透明的,而我想要一个默认的应用程序(纯白色)。有什么办法可以改变吗。。
我想补充一点,我尝试对此:iOS SDK - 使用 UIImagePickerController 时如何恢复状态栏? 方法:
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:NO];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES];
}
仅适用于我的相机,不适用于照片库。当然我也尝试过默认样式。
更新:我找到了一种更改导航栏的方法:
- (void)navigationController:(UINavigationController *)navigationController
willShowViewController:(UIViewController *)viewController
animated:(BOOL)animated {
navigationController.navigationBar.barStyle = UIBarStyleDefault;
}
这个可以工作,但是状态栏样式仍然是黑色的,而我需要默认的应用程序,所以是白色的。
非常感谢!
I'm creating an app, that is in some point turning photo library on. The problem is that status bar is black transparent in photo library while i want a default application one (solid white). Is there any way to change it..?
I would add, that i tried regarding to this: iOS SDK - How to get the status bar back when using UIImagePickerController? method:
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:NO];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES];
}
works only for camera for me, not photo library. Of course i tried with default style too.
UPDATE: i found out a way to change navigation bar:
- (void)navigationController:(UINavigationController *)navigationController
willShowViewController:(UIViewController *)viewController
animated:(BOOL)animated {
navigationController.navigationBar.barStyle = UIBarStyleDefault;
}
This one works, however status bar style is still dark, while i need the default application one, so white.
Many thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以不同的方式解决了我的问题。为了保持状态栏始终相同,我刚刚添加了 viewDidAppear 方法,该方法写在我的 rootViewController 的主帖子中,所以它始终是相同的,包括打开照片库
Fixed my problem in a different way. To keep the status bar always the same i just added viewDidAppear method, that is written in my main post to my rootViewController, so it is same all the time including turning photo library on