我查了很多问答,都没有好的结果。 所以我不得不在这里问:
我想在导航栏下方添加一个搜索栏。
这个搜索栏应该是固定的。 就像下面 iOS7 上的联系人一样。
任何人都可以帮我弄清楚吗?
最佳答案
你有一个 View Controller 。它有一个主视图。在该主视图内部是一个搜索栏 (UISearchBar),在其下方是一个表格 View (UITableView)。
您的 View Controller 嵌入在导航 Controller (UINavigationController) 中。
UINavigationController
MyViewController (UINavigationController) - child of the navigation controller
UIView - main view of MyViewController
|--- UISearchBar (subview of UIView)
|
|--- UITableView (another subview of UIView)
关于iOS7:如何在 iOS7 上添加固定的搜索栏,如联系人?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22133973/