【问题标题】:Status bar tint color of the background of popover gets white after opening the popover打开弹出框后弹出框背景的状态栏色调颜色变为白色
【发布时间】:2020-05-22 21:43:15
【问题描述】:

我使用弹出框以编程方式打开一个页面,应用程序的主题是浅色的,因此状态栏标签是黑色的。但是当弹出窗口打开时,状态栏的标签也会变白,在状态栏中什么也看不到。首先我认为是弹出页面的问题,但显然,当背景页面下降时,状态栏的色调颜色发生了变化。 在这里观看视频: https://streamable.com/ehvjl4

我怎样才能防止这种情况发生。

在应用程序中,preferredStatusBarStyle是白色的,它适用于除此情况之外的任何页面。

这是打开popover的代码

 func showlistCard() {
     let vc = ContainerlistCard()
     vc.modalPresentationStyle = .popover
     present(vc, animated: true, completion: nil)
 }

有什么建议吗?非常感谢

【问题讨论】:

    标签: swift statusbar popover


    【解决方案1】:

    将此行添加到viewDidLoad() 中的ContainerListCard

    modalPresentationCapturesStatusBarAppearance = true
    

    【讨论】:

      猜你喜欢
      • 2014-02-24
      • 2013-08-23
      • 2011-08-12
      • 1970-01-01
      • 1970-01-01
      • 2011-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多