IOS 状态栏 LigthContent

标签 ios objective-c iphone swift

<分区>

我尝试更改 IOS 应用程序的样式。使用以下方法。

UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false)
application.statusBarStyle = UIStatusBarStyle.LightContent

Xcode setting config

但我有默认样式的结果:

Result

如何解决?

最佳答案

转到项目目标的信息选项卡,添加行:

UIViewControllerBasedStatusBarAppearance,设置值NO

并将Deployment Info中的状态栏设置为Light

应该可行

关于IOS 状态栏 LigthContent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34038086/

相关文章:

ios - 不需要/未单击的对象自行增加

ios - Xcode gRPC 核心错误 : 'openssl_grpc/ssl.h' file not found

iphone - CGImageDestinationCreateWithData 没有创建 CGImageDestinationRef 对象

iphone - 如何制作 SystemSoundID 数组

ios - 当应用程序进入前台时重新加载 CloudKit 数据

ios - 如何用按钮操作替换 self.navigationItem.leftBarButtonItem = self.editButtonItem() }

ios - 在 Storyboard中使用私有(private)属性初始化 View Controller

ios - 带上传流的 NSURLSession - 子类化 NSInputStream - com.apple.NSURLConnectionLoader 异常

iphone - 处理数组中的多个字符串和整数

iphone - Objective-C CALayer UIView 真实旋转