I am creating a UIView programatically in loadView. The application has a UITabBarController and UINavigationController.
How do I create a view that automatically resizes when a tab bar and a navigation bar both exist?
My current approach to this problem is calculating the heights of the navigation and tab bar controllers and subtracting them from the mainScreen's height:
float navObjectsHeight = self.tabBarController.tabBar.frame.size.height
+ self.navigationController.navigationBar.frame.size.height;
CGRect mainFrame = CGRectMake(0, 0, screenFrame.size.width,
screenFrame.size.height - navObjectsHeight);
UIView *contentWrapper = [[UIView alloc] initWithFrame:mainFrame];