当我点击UISearchBar时,它改变了它的位置,并且tableview重叠了UISearchBar .i改变了它的位置,但它没有工作。
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
[UIView animateWithDuration:0.25 animations:^{
for (UIView *subview in self.view.subviews)
subview.transform = CGAffineTransformMakeTranslation(0, statusBarFrame.size.height);
subview.frame=CGRectMake(0, -200, 320, 64);
}];
}
}
点击搜索栏之前
点击搜索栏后
答案 0 :(得分:0)
应该设置:
[self.navigationController setNavigationBarHidden:YES animated:YES];