简体   繁体   中英

Navigation bar overlapping status bar

Is there any way to fix this? If I drag navigation bar little more down, background is shown which I don't want. Swift 2.1.

截图

Is this navigation bar part of a UINavigationController ? If not, I think you want to have your view controller be the delegate of the UINavigationBar and implement the positionForBar method to return UIBarPositionTop . That should cause the navigation bar to leave some room at the top for the status bar.

You can set the height constraint of your UINavigationBar to 60 , for example, as:

在此输入图像描述

如果您强制视图控制器在viewDidDisappear中显示应用程序的状态栏,则可能会发生这种情况。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM