对于我的表格 View ,我想包含一个搜索栏。 我搜索了它,我该如何做到这一点,但我唯一找到的是 iOS 7 的教程。那是与较新版本不兼容的。
有没有人有提示或代码,我该怎么做?
最佳答案
您始终可以设置自己的 UISearchBar 并将其作为 subview 添加到导航 Controller 。它也适用于 iOS8。
UISearchBar *customizeSearchBar = [[UISearchBar alloc] initWithFrame:...];
customizeSearchBar.delegate = self;
[self.navigationController.view addSubview:customizeSearchBar];
这只是我找到的一个例子: http://jduff.github.io/2010/03/01/building-a-searchview-with-uisearchbar-and-uitableview/
关于ios - Xcode - iOS8 的搜索栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30424688/