【问题标题】:Is it possible to change the font color of the status bar to a custom color?是否可以将状态栏的字体颜色更改为自定义颜色?
【发布时间】:2018-08-28 21:51:51
【问题描述】:

我想将显示时间和电池百分比的状态栏字体颜色设置为除枚举.default.lightContent UIStatusBar Documentation 之外的自定义颜色。 这可能吗?

【问题讨论】:

  • @Carpsen90 感谢您的关注,但是该问题涉及时间和电池百分比的超级视图栏的颜色。除了苹果.default.lightContent 提供的枚举之外,我想将字体的颜色而不是条形更改为自定义颜色。 developer.apple.com/documentation/uikit/uistatusbarstyle
  • 你能检查一下那里的答案吗? AFAIK 你的问题的答案是否定的。
  • @Carpsen90 感谢您的帮助。我已经检查过了,正如我之前提到的,该问题涉及设置 UIStatusBar 的背景颜色,这是底层视图。我想将 StatusBar 中包含的字体颜色更改为 .default.lightContent 以外的自定义颜色。

标签: ios swift uistatusbar


【解决方案1】:

对于生产应用程序,我认为这是不可能的,但是通过私有框架,您可以制作

(UIApplication.shared.value(forKey: "statusBar") as! NSObject).setValue(UIColor.red, forKey: "foregroundColor")

【讨论】:

  • 这将被 Apple 拒绝
猜你喜欢
  • 2018-06-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-08-16
  • 2015-03-05
  • 1970-01-01
相关资源
最近更新 更多