ios - 使用 uipresentviewcontroller 显示 uiviewcontroller 时,状态栏与导航栏重叠

标签 ios iphone swift

我在我的应用程序中呈现了一个 uiviewcontroller,但 Controller 与状态栏重叠。它只有导航栏,因此我的栏按钮与状态栏中的电池图标重叠。有什么想法可以在状态栏下方显示导航栏吗?我搜索了很多但找不到解决方案。我的代码来呈现 View Controller :

let timeVCObejct = self.storyboard?.instantiateViewControllerWithIdentifier("TimeConfigurationViewController") as? TimeConfigurationViewController
    timeVCObejct?.delegate = self
    self.presentViewController(timeVCObejct!, animated: true, completion: nil)

最佳答案

为您的 VC 使用此属性,以避免您的状态栏与您的 VC 重叠 swift :

self.edgesForExtendedLayout = []

objective-c C

self.edgesForExtendedLayout = UIRectEdgeNone;

关于ios - 使用 uipresentviewcontroller 显示 uiviewcontroller 时,状态栏与导航栏重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32604866/

相关文章:

iphone - 仅批准重定向到网页的App的批准

iphone - 高效删除名称包含子字符串的多个文件

ios - Mach O 链接错误 - 链接器命令失败,退出代码为 1(使用 -v 查看调用)

ios - 从 ViewController 取图片

ios - 在 UITableViewCell 中加载 React Native View (RCTRootView)

iphone - PresentModalViewController 使我的应用程序崩溃

swift - 如何为 NSTextField 的 textColor 设置动画?

swift - 如何在 Swift 中获取 PDF 中的所有文本?

swift - 隐藏后状态栏仍然显示为黑色

ios - '应用程序试图用 swift 3 模态呈现一个事件 Controller '