我正在实现 twitter 应用程序,例如 #Discover 选项卡的动画。当用户点击搜索栏时,导航栏消失,tableView 电影向上,取消按钮显示在搜索栏上。这是代码...
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar
{
[self.navigationController setNavigationBarHidden:YES animated:YES];
[self.searchBar setShowsCancelButton:YES animated:YES];
[self.scrollView setContentOffset:CGPointMake(0, 55) animated:YES];
[self.view addSubview:backImgView];
return YES;
}
这非常有效,但仅在我第一次点击搜索栏时才需要大约半秒的延迟,之后它的速度很快。有任何想法吗?