I would like to display an UIView above my tableview, for testing purposes I have used a Searchbar (to eliminate any possible problems with my code).
My setup:
Tab bar controller
MyCustomTableViewController
View
TableView (for customizing cell height)
Searchbar
I have positioned the searchbar at the top of the “window” and pulled down the tableview so that it is positioned directly below the searchbar.
So in IB everything looks great.
But when I start the application the tableview takes up the whole screen, and the searchbar is nowhere to be found.
I’m quite new to IPhone development so there might be a very simple solution(?).
/Jimmy
The really simple solution is to:
UITableViewDelegateandUITableViewDataSourcejust likeUITableViewControllerdoes. Also add aUITableViewoutlet.UITableViewinside the view controller’s view.tableViewoutlet in your customUIViewControllerUITableView‘s delegate and datasource to the File’s Owner (your customUIViewControllerthat implements the right delegates)You now have a custom view controller that works just like a
UITableViewControllerexcept you have total control over it’s layout. You implement the delegates in the same way.