Resizing viewControllers view that are part of a UINavigationController on IPhone

iphoneuinavigationcontrolleruitabbar

I am using a UINavigationController to handle the pushing and poping of viewControllers in my app. Theres a section where i have a tab bar (not using UITabbarController) which is manageed by the same UINavigationController, i simply add the UITabBar to the navigation controllers view (by using addSubview).

The Problem:
I have some UIViewControllers with table views being pushed into the navigation stack, since my Tab Bar is part of the view and not the navigation stack the TableViews are cut off at the buttom because the Navigation Controller does not know of the tab bar because its in its view and n ot the navigation stack. Without a navigation controller i would just resize the ViewControllers view and it would work fine, but when i try to do that it seems like the NavigationCOntroller just ignores my frame and sets its own and therefore the table views are cut off. I found one solution which was to add some extra cells and hide them and that works sort of OK but its kind of hackerish, anyone have any suggestion of how to go about this in a different non -hackerish way?

Thanks

Best Answer

Alright, so i solved the problem. I had tried resizing the UITableView instead of the viewController before, but this did not work. I just realized though, that this did not work because i was using a UITableViewController which manages its own tableView and was not letting me change the frame of it (maybe i was changing it in the wrong place, tried in viewDidLoad, i bet if i did it after the call to [super viewDidload] it would have worked..o well). So I changed the class to a UIViewController and managed the table view in there, now it works good, thanks for the replies.

Related Topic