iOS Hiding tab bar in iOS 6 creates black bar (fix for iOS 6 breaks iOS 7!)

后端 未结 4 1961
南方客
南方客 2020-12-28 11:15

I\'ve got a tabbed application and in one tab there is a UIWebView. When I rotate the device to landscape I\'ve made the UIWebView full screen whil

4条回答
  •  有刺的猬
    2020-12-28 12:03

    -(void) hideBottomTabs{
    // Get the size of the main screen
    CGRect fullScreenRect = [[UIScreen mainScreen]bounds];
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){
        UITabBar *bar = ((UITabBarController *)self.parentViewController).tabBarController.tabBar;
        fullScreenRect.size.height += ViewHeight(bar);
    }
    // Hide the tab bar
    ((UITabBarController *)self.parentViewController).tabBarController.tabBar.hidden = YES;
    // Resize and fill the screen
    [[((UITabBarController *)self.parentViewController).view.subviews objectAtIndex:0] setFrame:fullScreenRect];
    

    }

    I have solved my problem in a such way.

提交回复
热议问题