导航栏上面添加UISearchBar pop回去的时候不会把添加的导航栏带回去
将UISearchBar添加到导航栏上面有2种方法
1.会将搜索条带到别的导航栏上,可以和
[UISearchDisplayController同步使用有动画
[self.navigationController.view addSubview:self.searchBar];
2.不会将导航栏带过去,
UISearchDisplayController的tableview不能正常使用
self.navigationItem.titleView = self.searchBar;
3.放在tableview的headerView上面同步使用
UISearchDisplayController
4.使用
UITextField
自定义搜索条,网上有教程这里就不再粘贴代码。