I have a UISearchBar (with UISearchDisplayController) as title view of UINavigationBar. There are also two buttons on either side of the searchbar within the navbar.
When clicking on UISearchBar, it becomes wider and covers the button on the right of it.
How can I stop it from becoming wider?
Things tried but didn't work -->
- The widened search bar then becomes the original size if the device is rotated.
So, tried calling [searchBar setNeedsLayout]in -searchBarTextDidBeginEditing
- All different auto-resizing maskoptions inIB
Edit: Didn't mention, but this is on iPhone (as we can put searchbar inside toolbar in iPad..)
 
     
    