123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #import "REMenuContainerView.h"
- #import <QuartzCore/QuartzCore.h>
- @implementation REMenuContainerView
- - (void)layoutSubviews
- {
- [super layoutSubviews];
- UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
-
- CGFloat landscapeOffset = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ? 32.0 : 44.0;
-
- if (self.navigationBar && !self.appearsBehindNavigationBar) {
- CGRect frame = self.frame;
- frame.origin.y = self.navigationBar.frame.origin.y + (UIDeviceOrientationIsPortrait(orientation) ? 44.0 : landscapeOffset);
- self.frame = frame;
- }
-
- if (self.appearsBehindNavigationBar) {
- CGRect frame = self.frame;
- long height = [[UIScreen mainScreen] bounds].size.height;
-
- if (([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortrait) || [[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown) {
- frame.origin.y = 0;
- frame.size.height = height;
- } else {
-
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
- frame.origin.y = -12;
- frame.size.height = height + 12;
- } else {
- frame.origin.y = 0;
- frame.size.height = height;
- }
- }
-
- self.frame = frame;
- }
- }
- @end
|