使用 self.navigationController.hidesBarsOnSwipe = true 隐藏导航栏,将其永久隐藏 [英] Hiding Navigation bar with self.navigationController.hidesBarsOnSwipe = true, hides it permanently
问题描述
我的视图控制器中有一个 UITableView
对象,我在 viewDidAppear:
中添加了以下代码:
self.navigationController.hidesBarsOnSwipe = true
当我向上滚动时导航栏隐藏,但当我向下滚动时它不会回来.
我还需要做些什么吗?
storyboard默认添加tableview top约束到Top Layout Guide.Bottom",需要将tableview.top约束改为View.Top">
I have a UITableView
object in my view controller and I added the following code inside viewDidAppear:
:
self.navigationController.hidesBarsOnSwipe = true
The navigation bar is hiding when I scroll up, but when I scroll down it's not coming back.
Do I need to do something else?
By default storyboard add tableview top constraint to "Top Layout Guide.Bottom", you need to change the tableview.top constraint to "View.Top"
这篇关于使用 self.navigationController.hidesBarsOnSwipe = true 隐藏导航栏,将其永久隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!