简体   繁体   English

如何使TableView控制器上的视图覆盖导航栏?

[英]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.

相关问题 如何使用导航栏转换到视图控制器? - How to make the transition to a view controller with a navigation bar? 如何制作可以覆盖导航栏的UIView? - How to make a UIView that can cover the navigation bar? 从TableView推送视图控制器后如何保持导航栏标题大 - How to keep navigation bar title large after pushing view controller from TableView 如何在表格视图单元格上按以向视图控制器显示导航控制器中的文本 - How to press on a tableview cell to present a view controller with the text in navigation controller 使用TableView向视图控制器添加导航 - Adding a Navigation to a View Controller with a TableView TableView Controller +导航控制器+标签栏 - TableView Controller + Navigation Controller + Tab bar 如何隐藏导航控制器内部特定视图控制器上的导航栏 - How to hide navigation bar on a particular view controller inside of navigation controller 标签栏为初始视图控制器时,如何使“返回”按钮出现在导航控制器中 - How to make 'Back' button appear in Navigation Controller when Tab Bar is initial view controller 如何从视图中删除导航栏 controller - How to remove navigation bar from view controller 如何在视图控制器上获取导航栏? - How to get the navigation bar on view controller?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM