I realize there will be comments such as this is duplicate :
Change the Width of UISearchBars on a TableView
I think it is not. Why am I unable to change the width in the storyboard?
I can write in the width field any value but as soon as I push return/enter key value 320 is restored.
I've tried also to do it in view did load method :
searchBar.frame = CGRectMake(0, 0, 222, 45);
With zero success again, does anyone knows how to do this? I have an indexed table and the letters on the right overlap with the search text field and it looks really ugly.
Update
In simple words here is what I want (Conceptually) :
This is what I managed to produce :
Again let me re-iterate the issue "I'm trying to resize my search bar so the letters won't overlap it".
I've tried taus-iDeveloper suggestion, it did resize but the table cells/sections overlapped it.
Also tried this :
Changing the size of the UISearchBar TextField?
I manage to resize it in storyboard but when application is running the size hasn't change.
I'm all out of ideas what to try next ..
Update 2
I accepted the answer because it has some elements of solution, I came to conclusion that this cannot be done using storyboard only programmatically, solution :
//Add the search bar uiview wrapper
UIView *searchBarView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, self.tableView.frame.size.width, 44.0)];
//Add the search bar and navigation item to fill in the remaining space
UINavigationBar *remainingSearchSpace = [[UINavigationBar alloc] initWithFrame:CGRectMake(290, 0.0, (self.tableView.frame.size.width-290), 44.0)];
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 290, 44.0)];
searchBar.delegate = self;
[searchBarView addSubview:searchBar];
[searchBarView addSubview:remainingSearchSpace];
self.tableView.tableHeaderView = searchBarView;