状态栏样式从浅色内容更改为灰色样式

问题描述 投票:1回答:1

我的一个应用程序我为Translucent设置了StatusBar颜色。

在前2个屏幕中,它按预期显示,但在第3个屏幕上,它将改变状态栏的样式。它将转换为灰色半透明。

预期的屏幕样本:

enter image description here

目前的问题:

enter image description here

我在应用程序中完成了与show Light Content Status栏相关的所有更改。

将状态栏显示为UIStatusBarStyleLightContent

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

如下所述,还将标志添加到plist。

enter image description here

但在我的应用程序中仍然存在上述问题。

任何帮助将不胜感激。

ios objective-c storyboard statusbar
1个回答
0
投票

你必须在你的下面添加如下代码

AppDelegate类方法appDidFinishLaunching

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

不仅如此,您还必须在info.plist文件中添加状态栏样式。

快乐的编码!

© www.soinside.com 2019 - 2024. All rights reserved.