From f0f51e0c5059753a6f821bf57c2a62eaa3978729 Mon Sep 17 00:00:00 2001 From: subvin Date: Mon, 11 Dec 2017 22:17:22 +0800 Subject: [PATCH] Update MMDrawerController.m Adapt for statuBar height is not equal to 20.0f . --- MMDrawerController/MMDrawerController.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MMDrawerController/MMDrawerController.m b/MMDrawerController/MMDrawerController.m index 4aec238b..e5af3fc0 100644 --- a/MMDrawerController/MMDrawerController.m +++ b/MMDrawerController/MMDrawerController.m @@ -945,8 +945,8 @@ -(void)setShowsStatusBarBackgroundView:(BOOL)showsDummyStatusBar{ _showsStatusBarBackgroundView = showsDummyStatusBar; CGRect frame = self.childControllerContainerView.frame; if(_showsStatusBarBackgroundView){ - frame.origin.y = 20; - frame.size.height = CGRectGetHeight(self.view.bounds)-20; + frame.origin.y = [UIApplication sharedApplication].statusBarFrame.size.height; + frame.size.height = CGRectGetHeight(self.view.bounds)-[UIApplication sharedApplication].statusBarFrame.size.height; } else { frame.origin.y = 0; @@ -1022,7 +1022,7 @@ -(UIView*)childControllerContainerView{ -(UIView*)dummyStatusBarView{ if(_dummyStatusBarView==nil){ - _dummyStatusBarView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 20)]; + _dummyStatusBarView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), [UIApplication sharedApplication].statusBarFrame.size.height)]; [_dummyStatusBarView setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; [_dummyStatusBarView setBackgroundColor:self.statusBarViewBackgroundColor]; [_dummyStatusBarView setHidden:!_showsStatusBarBackgroundView];