点击取消按钮后,示波器栏位于搜索栏旁边......但代码为:
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
searchBar.showsScopeBar = YES;
[searchBar sizeToFit];
[searchBar invalidateIntrinsicContentSize];
[searchBar setShowsCancelButton:YES animated:YES];
tabellaCanzoni.tableHeaderView = self.searchDisplayController.searchBar;
}
我希望它保持在搜索之下,而不是在旁边!
答案 0 :(得分:1)
这段代码一切正常:
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
[_barraRicerca resignFirstResponder];
_barraRicerca.text = nil;
[_barraRicerca setShowsScopeBar:YES];
[_barraRicerca sizeToFit];
isFiltered=FALSE;
[tabellaVideo reloadData];
}