Hassy
Hassy

Reputation: 5208

iOS - UISearchBar width changes in iOS8

I have been using UISearchbar in my project with no problem at all in iOS7 now when i build my project using Xcode 6.0.1 and run on iOS8 the width of UISearchBar automatically changes for example

I am not using auto layout, when i enable auto layout the issue is solved but whatever i do to change the frame in code nothing happens.

I don't want to enable autoLayout, how can i solve this problem?

Upvotes: 1

Views: 1158

Answers (1)

Hassy
Hassy

Reputation: 5208

I solved this problem by using following code

-(void)viewWillLayoutSubviews
{
    searchbar.frame = CGRectMake(365, 0, 274, 44);
}

Hope this help someone

Upvotes: 4

Related Questions