UISearchBar 与隐藏的 UINavigationBar
我的搜索栏位于表格顶部,还有隐藏的导航栏。与 UISearchBar 一起,我使用 UISearchDisplayController。 UISearchDisplayController 可以向前显示导航栏。因此,当我点击搜索栏中的取消按钮时,导航栏就会下降。我怎样才能消除这种可能性,使导航栏始终隐藏?
谢谢
I have the search bar in the top of the table and the hidden navigation bar. Along with UISearchBar I use UISearchDisplayController. UISearchDisplayController has the possibility to bring forward the navigation bar. So, when I tap the cancel button in the search bar, the navigation bar fly's down. How can I dismiss this possibility, so the navigation bar will always be hidden?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种解决方案是使搜索栏成为表格标题视图,在这种情况下,它将与表格一起滚动,如果您不希望它默认显示,那么您可以以编程方式向下滚动表格(非动画),在 viewWillAppear 中首先显示。这对于您的 UI 设计可能有意义,也可能没有意义,但它就是 Safari 的基本工作原理。
One solution is to make the search bar the table header view in which case it will scroll with the table, and if you don't want it to appear by default then you can programmatically scroll the table down, non-animated, in viewWillAppear it is first displayed. This may or may not make sense for your UI design, but it is, for example, how Safari basically works.
终于!!!我找到了解决方案IPHONE:ABPeoplePickerNavigationController隐藏导航栏
Finnaly!!!! I've found the solution IPHONE: ABPeoplePickerNavigationController hidden navigation bar