Reputation: 1162
I am having an issue where the UISearchBar keeps resizing once i click away then goes back, to the appropriate size. I am setting the frame and the bounds like so in the init.
[_searchBar setFrame:CGRectMake(10, 10, 300, 20)];
[_searchBar setBounds:CGRectMake(10, 10, 300, 20)];
I am also doing this for layoutSubviews
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
[_searchBar setFrame:CGRectMake(10, 10, 300, 20)];
[_searchBar setBounds:CGRectMake(10, 10, 300, 20)];
}
Upvotes: 1
Views: 81
Reputation: 1162
So the real true way to solve this is to use Autolayout with visualConstraints. The searchbox no longer resized once I started to use it.
Upvotes: 1