I am creating a UIView programmatically in loadView . The application has a UITabBarController and a UINavigationController.
How to create a view that automatically resizes if there is a tab bar and navigation bar?
My current approach to this problem is to calculate the heights of the navigation controllers and the tab bar and subtract them from the height of the main screen:
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];
objective-c iphone uiview uitabbarcontroller uinavigationcontroller
dianovich
source share