aryaxt / iOS-Slide-Menu

iOS Slide Menu with ability to add both left and right menu, and built in gesture recognizer. Similar to Path and Facebook
Other
1.53k stars 359 forks source link

When in-call status bar is on animation is wrong #126

Open MrMeMr opened 9 years ago

MrMeMr commented 9 years ago

The slide performs an horizontal animation to (newX, 0) which causes a diagonal animation, and sets content in wrong y position.

aryaxt commented 9 years ago

What version of the app are you using? Are you building against iOS8?

MrMeMr commented 9 years ago

no building against ios7.1

aryaxt commented 9 years ago

Build against 8.0, or use the version that doesn't have iOS8 supports

MrMeMr commented 9 years ago

I need to support older devices though. I'm using version 1.4 of iOS-Slide-Menu

aryaxt commented 9 years ago

You can build against 8.0 and still support older versions. Deployment target can be 6.0, base SDK could be 8.1

Let me know if that fixes the problem

MrMeMr commented 9 years ago

Sorry for the confusion. This is the current setup: Base sdk: 8.1 Deployment on simulator of iPhone 5 with iOS 7.1

aryaxt commented 9 years ago

Will look into this

ebfhub commented 9 years ago

You can fix this by calculating the extra status height:

/* Adjust for in-call, personal hotspot, status bar / -(float)offsetFromTop { UIView *view = self.view; CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame]; CGRect statusBarWindowRect = [view.window convertRect:statusBarFrame fromWindow:nil]; CGRect statusBarViewRect = [view convertRect:statusBarWindowRect fromView:nil]; float fullHeight = statusBarViewRect.size.height; float offset = fullHeight; if (![UIApplication sharedApplication].statusBarHidden) offset -= STATUS_BAR_HEIGHT; return offset; }

Then use this in initialRectForMenu AND moveHorizontallyToLocation: rect.origin.y = [self offsetFromTop];

I've only tested this on IOS 8 (latest).

eJamesLin commented 9 years ago

solution from @ebfhub should works for me, thanks.