简体   繁体   English

iOS11中的导航栏问题

[英]Navigation bar issue in iOS11

I was working perfectly with navigation bars iOS 10 and below previously. 以前,我与导航栏iOS 10及以下版本完美配合。 But now when moving to the iOS 11, It's bit weird with the navigation bar. 但是现在移到iOS 11时,导航栏有点奇怪。 The entire navigation bar is going up with all the navigation items. 整个导航栏都包含所有导航项。 Here I've attached a screenshot of the current behavior. 在这里,我附加了当前行为的屏幕截图。

在此处输入图片说明

Is this relate to constraints? 这与约束有关吗? And I don't need to user large titles in my application. 而且我不需要在应用程序中使用大标题。 As I think this is a matter with large titles. 我认为这与大标题有关。 I've added the following code, in order to disable the large titles. 我添加了以下代码,以禁用大标题。

if (@available(iOS 11.0, *)) {
    [[self navigationController] navigationBar].prefersLargeTitles = NO;
    [[self navigationController] navigationItem].largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
}

How may I fix this issue? 我该如何解决这个问题?

Check whether you have set custom frame on navigation bar. 检查是否在导航栏上设置了自定义框架。 If you have, please remove them and check. 如果有,请删除它们并检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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