An answer from this question helped me realize this is somehow related to the nav bar being translucent. When I set the nav bar translucent to NO I had the issue. When I stopped making it NO, it works fine.
Hiding UISearchBar in iOS 7 crops top row
-
23-06-2023 - |
문제
I am calling the following function to successfully hide my search bar in viewDidLoad:
- (void)hideSearchBar {
CGRect newBounds = self.tableView.bounds;
newBounds.origin.y = newBounds.origin.y + _searchBar.bounds.size.height;
self.tableView.bounds = newBounds;
}
but if I call the exact same function in (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar
the top row of my table view becomes overlapped with the navigation bar. Why is this overlap only happening when calling the hide function from searchBarTextDidEndEditing
?
해결책
제휴하지 않습니다 StackOverflow