Resize viewControllers that are part of the UINavigationController on IPhone

I am using UINavigationController to handle pushing and poping viewControllers in my application. This is the section where I have a tab bar (not using UITabbarController) that is controlled by the same UINavigationController, I just add a UITabBar to the view of the navigation controllers (using addSubview).

Problem: I have some UIViewControllers that display table views in the navigation stack, since the tab bar is part of the view and not the navigation stack, TableViews are cropped in buttom because the navigation controller does not know the tab bar, because its appearance and n from the navigation stack. Without a navigation controller, I would just change the view of the ViewControllers and it would work fine, but when I try to do this, it looks like the NavigationCOntroller just ignores my frame and sets its own, and therefore the views in the table are disabled. I found one solution that was to add a few extra cells and hide them, and it works like OK, but its a hacker, who has any suggestions on how this is otherwise uncharacteristic?

thanks

+3
source share
2 answers

Ok, so I solved the problem. I used to try resizing a UITableView instead of a viewController, but that didn't work. I just realized that this did not work, because I used the UITableViewController, which controls my own table view and did not allow me to change its structure (maybe I changed it in the wrong place, tried in viewDidLoad, I set if I did it after calling [super viewDidload], this would work ... well). So I changed the class to UIViewController and controlled the table view there, now it works well, thanks for the answers.

+1
source

UIView UITableView . UITabBar UIView. UITableView UINavigationController.

0

Source: https://habr.com/ru/post/1715559/


All Articles