I have a problem with a UISearchBar programmatically added inside a UIView (in one of the TabBarController child views):
When the screen is first loaded, the search bar is too wide to fully fit into the view. However, when you click inward and then click the Cancel button, the search bar changes so that it fits well with the UIView.
I uploaded a sample project to GitHub - the wrong behavior can be seen on the second tab in the BlueViewController class. I already tried a lot, as you probably see in the code and view the most popular StackOverflow answers, but none of them have fixed this problem for me so far.
Here's a link to the project: https://github.com/asia-t/tabbartest
It would be great if someone could shed light on what could be happening there.

source share