我有一个iOS 7应用程序,我在didFinishLaunchingWithOptions中将状态栏文本设置为白色,如下所示:
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];我有一个带有javascript的webview,它调用本机Image Picker。在Image Picker中,当我从图片库中选择一张照片时,状态栏文本会被重置为黑色。
纠正这种情况的一种方法是在Image Picker关闭时再次应用上述代码。但是,我无法检测到此事件,因为它在the视图上。
知道怎么解决这个问题吗?
发布于 2014-02-17 05:37:39
我通过实现这一点来解决这个问题:
-(void) viewDidAppear:(BOOL)animated
{
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
[super viewDidAppear:animated];
}一旦照片库关闭,此代码将被调用。
发布于 2014-02-14 07:01:46
在ViewController中尝试这段代码,它对我有用
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}发布于 2014-02-14 06:48:17
试着用下面的步骤。
-> Set the "View controller-based status bar appearance" to "NO" in the plist然后使用
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}https://stackoverflow.com/questions/21772543
复制相似问题