My application has a table controller, which is presented as a form sheet.
There is a UView at the top of the tableviewcontoller, and inside this UIView there is a navigation bar and a search bar.
Everything works fine with the older version of iOS, but in iOS7, when the user picks up the search bar, everything is messy.
Normal: 
When the user starts typing: 
After the ends: 
in.h
UITableViewController<UITextFieldDelegate,UISearchDisplayDelegate,UISearchBarDelegate> @property (nonatomic,weak) IBOutlet UINavigationBar *topBar;
Tried a few things, but the code doesn't seem to change anything when a breakpoint is set, which it introduces to delegate methods, although
in.m
//-(void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller { // if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { // CGRect statusBarFrame = self.topBar.frame; // [UIView animateWithDuration:0.25 animations:^{ // for (UIView *subview in self.tableView.subviews) // subview.transform = CGAffineTransformMakeTranslation(0, statusBarFrame.size.height+50); // }]; // } //} // //-(void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller { // if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { // [UIView animateWithDuration:0.25 animations:^{ // for (UIView *subview in self.tableView.subviews) // subview.transform = CGAffineTransformIdentity; // }]; // } //} - (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller { if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { CGRect frame = self.searchDisplayController.searchBar.frame; frame.origin.y += self.topBar.frame.size.height; self.searchDisplayController.searchBar.frame = frame; } } - (void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller { if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { CGRect statusBarFrame = self.topBar.frame; CGRect frame = self.searchDisplayController.searchBar.frame; frame.origin.y -= statusBarFrame.size.height; self.searchDisplayController.searchBar.frame= frame; } } #Additional Info - (void)viewDidLoad { [super viewDidLoad]; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { //self.searchDisplayController.searchBar.searchBarStyle= UISearchBarStyleProminent; self.edgesForExtendedLayout = UIRectEdgeNone; //self.edgesForExtendedLayout = UIRectEdgeLeft | UIRectEdgeBottom | UIRectEdgeRight; } }

In accordance with the point and the size of the breakpoint right attitude and frame sizes, but they do not change self.searchDisplayController.searchBar.frame at all
I also tried
-(void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller { if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { [self.topBar setHidden:YES]; } } -(void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller { if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { [self.searchDisplayController.searchBar removeFromSuperview]; CGRect frame = self.searchDisplayController.searchBar.frame; frame.origin.y += self.topBar.frame.size.height; self.searchDisplayController.searchBar.frame = frame; [self.topView addSubview:self.searchDisplayController.searchBar]; [self.topView bringSubviewToFront:self.topBar]; [self.topBar setHidden:NO]; } }
How can I solve this problem?
u.gen source share