gpt4 book ai didi

ios - UIModalViewController StatusBar背景颜色

转载 作者:行者123 更新时间:2023-11-29 03:02:32 26 4
gpt4 key购买 nike

我使用宏颜色通过外观设置了UINavigationBar背景色调:

[[UINavigationBar外观] setBarTintColor:UIColorFromRGB(0x6DBEE8)];

在整个基于导航的应用程序中,但在我的 UIModalViewController 中不起作用:

在我的plist中,我有:查看基于 Controller 的状态栏外观:是

我在全局设置了appearance:[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

这是它的样子: enter image description here

最佳答案

那是因为在 iOS7 中,UINavigationBar 的高度在包含在 UINavigationController 中时会增加(64 点)。由于状态栏是透明的,当您以模态方式呈现 View Controller 时,它不在 UINavigationController 中,因此高度正常(44 点),因此 map View 位于状态栏后面。您需要在模态视图 Controller 中处理此问题。您可以:

  • 完全隐藏状态栏(有效但可能不适合每一种情况)
  • 在导航栏后面和状态栏所在的位置放置一个 View 相同的背景颜色。
  • 将 View Controller 的 View 本身的颜色更改为所需的颜色,并且偏移 map View 的 y 位置以适应状态栏的高度。

关于ios - UIModalViewController StatusBar背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23152438/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com