romaonthego / REFrostedViewController

iOS 7/8 style blurred view controller that appears on top of your view controller.
MIT License
2.96k stars 494 forks source link

menu is floating behind statusbar with ios < 7.0 #14

Closed minddust closed 11 years ago

minddust commented 11 years ago

the startpoint of the menu is 0,0 of the total screen. the status bar is covering the first 20px. with >= 7.0 the behavior is just fine but not below. looking for a solution, but maybe you already know? thanks

romaonthego commented 11 years ago

Sorry, I don't really understand your issue. Can you add insets on top of your menu to compensate the 20px?

minddust commented 11 years ago

the main content starts beneath the status bar but the menu don't. you can see it on the scrollbar.

statusbar overlaps
minddust commented 11 years ago

found a hacky solution... don't feel comfortable with that and dunno about side effects but works for now.

// REFrostedViewController
- (void)commonInit
{
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
    {
        self.wantsFullScreenLayout = YES;
    }
    // ...
}

and..

// AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // ...

    [self.window makeKeyAndVisible];

    CGRect frame = self.window.rootViewController.view.frame;
    frame.origin.y = 0;
    self.window.rootViewController.view.frame = frame;

    return YES;
}
romaonthego commented 11 years ago

You can adjust contentInset and scrollIndicatorInsets of your UITableView:

#import "RECommonFunctions.h"

...

if (!REUIKitIsFlatMode()) {
    self.tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);
    self.tableView.scrollIndicatorInsets = self.tableView.contentInset;
}
uzman commented 10 years ago

hi, it (adjusting contentinset) works for uitableview. but i open REfrostedview with uinavigationcontroller. i have same problem with navigation bar. how can i solve it?

menuController = [[MenuViewController alloc] initWithNibName:@"MenuView" bundle:nil];
menuController.delegate=self;
MainNavigationController *menuNC = [[MainNavigationController alloc] initWithRootViewController:menuController];
frostedViewController = [[REFrostedViewController alloc] initWithContentViewController:_tabBarController menuViewController:menuNC];