UISearchDisplayController定位问题

时间:2014-09-17 12:46:10

标签: ios7 xcode5 uisearchbar uisearchdisplaycontroller

当我点击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);
 }];
 }

}

点击搜索栏之前

enter image description here
点击搜索栏后

enter image description here

1 个答案:

答案 0 :(得分:0)

应该设置:

[self.navigationController setNavigationBarHidden:YES animated:YES];