[英]How to make a view on a TableView controller cover the navigation bar?
I have a view in a view controller with a custom background, and a navbar that is clear. 我在具有自定义背景的视图控制器中有一个视图,并且导航栏很清晰。 the problem is that when I add the navbar to this table view controller, the view doesn't cover the back nav bar, so the nav bar looks black.
问题是,当我将导航栏添加到此表视图控制器时,该视图不会覆盖后导航栏,因此导航栏看起来是黑色的。 How can I make the view to cover also the nav bar?
如何使视图也覆盖导航栏?
This is what happens In the table view controller, as you can see the view ends when the nav bar starts 这是在表视图控制器中发生的情况,因为您可以看到导航栏开始时视图结束
And this is how I want the nav bar to look like; 这就是我想要的导航栏看起来的样子; this doesn't happen when a view controller is embeded in the nav bar, it only happens in a table view controller
将视图控制器嵌入到导航栏中时,不会发生这种情况,只会在表视图控制器中发生
The problem is that your view's top constraint is pinned to the nav bar rather than the top of the view. 问题在于,视图的顶部约束固定在导航栏上,而不是视图的顶部。 Just change the top of the table view to be pinned to the top of the screen instead of the bottom of the nav bar.
只需将表格视图的顶部更改为固定在屏幕顶部,而不是导航栏的底部即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.