File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,10 @@ - (void)iOS6_hideMenuCompleted {
192
192
193
193
194
194
-(CGFloat)offset {
195
+ return ([self isLandscape ] && !SYSTEM_VERSION_LESS_THAN (@" 8.0" )) ? 20 .0f : 0 .0f ;
196
+ }
197
+
198
+ -(bool )isLandscape {
195
199
UIInterfaceOrientation interfaceOrientation;
196
200
197
201
// Check if we are running an iOS version that support `interfaceOrientation`
@@ -202,9 +206,15 @@ -(CGFloat)offset {
202
206
interfaceOrientation = [UIApplication sharedApplication ].statusBarOrientation ;
203
207
}
204
208
205
- return UIInterfaceOrientationIsLandscape (interfaceOrientation) ? 20 . 0f : 0 . 0f ;
209
+ return UIInterfaceOrientationIsLandscape (interfaceOrientation);
206
210
}
207
211
212
+ -(CGFloat)correctWidth {
213
+ CGRect screenRect = [[UIScreen mainScreen ] bounds ];
214
+ CGFloat max = MAX (screenRect.size .width , screenRect.size .height );
215
+ CGFloat min = MIN (screenRect.size .width , screenRect.size .height );
216
+ return [self isLandscape ] ? max : min;
217
+ }
208
218
209
219
- (void ) drawOpenLayer {
210
220
[openMenuShape removeFromSuperlayer ];
@@ -281,6 +291,7 @@ -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOr
281
291
282
292
CGRect menuFrame = self.menu .frame ;
283
293
menuFrame.origin .y = self.menubar .frame .size .height - self.offset ;
294
+ menuFrame.size .width = [self correctWidth ];
284
295
self.menu .frame = menuFrame;
285
296
286
297
[self drawClosedLayer ];
You can’t perform that action at this time.
0 commit comments