UISearchBar范围按钮的iOS可视化发生变化

时间:2013-03-13 11:29:51

标签: ios ipad tableview uisearchbar

点击取消按钮后,示波器栏位于搜索栏旁边......但代码为:

- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
searchBar.showsScopeBar = YES;
[searchBar sizeToFit];
[searchBar invalidateIntrinsicContentSize];
[searchBar setShowsCancelButton:YES animated:YES];
tabellaCanzoni.tableHeaderView = self.searchDisplayController.searchBar;
}

我希望它保持在搜索之下,而不是在旁边!

1 个答案:

答案 0 :(得分:1)

这段代码一切正常:

- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
[_barraRicerca resignFirstResponder];
_barraRicerca.text = nil;
[_barraRicerca setShowsScopeBar:YES];
[_barraRicerca sizeToFit];
isFiltered=FALSE;
[tabellaVideo reloadData];
}