简体   繁体   中英

iOS: table view's title bar covered by navigation bar unexpectedly

I'm developing a simple UI for an iOS app. what I've done is I developed it into a table view which has a navigation controller associated to it and had it laid out in Storyboard.

Everything seems working fine, except the navigation bar accidentally cover the view's title bar "Click to select item" as shown in the pictures below.

  1. the first picture is when it first shows on the screen.
  2. the second one illustrates when I drag the title bar off the covering navigation bar.

what do i do to get completely rid of this?

不幸的是,我的标题栏在导航栏下方

当我向下移动标题时

在此处输入图片说明

In Interface Builder, select your view controller and on the attributes inspector turn off Layout: Wants Full Screen. Then, your layout will automatically adjust its size to make room for the navigation bar.

Add this code in your viewDidLoad method

self.navigationController?.navigationBar.translucent = false

It works for me, since you've the same problem with me, I think it's work for you as well.

您要隐藏导航栏的位置使用此行

self.navigationController.hidden = YES;

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