Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISearchBar appearing at *bottom* of UITableView

Hope someone knows what to do, this is driving me nuts !

I've got a very simple UITableViewController, in an existing application, to which I have added a UISearchBar using interface builder (drag n drop)

Note: This problem exists when testing in either iOS 6 or iOS 7

My problem is that when the application is run, the searchbar is displayed at the BOTTOM of the results

enter image description here

When I click into the search area to perform a search, the searchbar then flicks to the top of the page

enter image description here

At first I thought "this is me", so I deleted the controller completely, including all code, and rebuilt from scratch the page in order to avoid any mistake I may have made. Unfortunately with the same result

The structure in IB is :

structure

The controller code just does bare basic at the minute, just cellForRowAtIndexPath

like image 756
Izzy Manpo Avatar asked Feb 05 '14 18:02

Izzy Manpo


1 Answers

Just add a prototype cell and put the search bar on top. You don't have to ever use the prototype cell.

like image 146
Mika Avatar answered Nov 03 '22 08:11

Mika