【发布时间】:2012-11-18 21:02:27
【问题描述】:
我有一个在单元格中显示数据的 UITableViewController。在viewWillAppear 中,我使用此方法self.tableView.tableHeaderView =headerView; 向tableHeaderView 添加了一个UIView
在headerView 中,我以编程方式添加了一个 UISearchBar 和一个 UISegmentControl。我这样设置 UISearchBar 委托
self.searchDisplay.delegate = self;
self.searchDisplay.searchBar.delegate = self;
self.searchDisplay.searchResultsDataSource = self;
self.searchDisplay.searchResultsTableView.delegate = self;
searchDisplay 是 UISearchDisplayController。
搜索工作完美,但我的问题是当我从 searchResultsTableView 中选择一个单元格并在 UINavigationController 中触摸后退按钮时转到另一个视图控制器并返回此视图时,表格不再滚动。
我在viewDidLoad和viewWillAppear中添加了这两个方法,但还是不行
self.tableView.bounces = YES;
self.tableView.scrollEnabled = YES;
当我在没有搜索的情况下从表中选择一行并返回时,它工作得很好。
有什么问题?
【问题讨论】:
-
你在 didSelectRowAtIndexpath: 方法中有什么
-
@R.A : 我有这个方法 performSegueWithIdentifier: sender:
-
将您的
viewWillAppear代码移至viewDidLoad
标签: ios uitableview scroll uisearchbar