-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New StatusBarBackgroundView Variable Mode. #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This solution mimics the contacts drawer used in the facebook App, where the status bar background becomes visible as the drawer opens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in the method name
Nice work here! I'd like to get this merged in in the next couple of weeks (WWDC will slow me down). |
The README will also need some TLC. |
Hi there, I'm glad you liked it. I fixed the typo and made some changes to the README to better explain the new feature. Hope you have a good time at WWDC! |
Conflicts: README.md
On iOS 7, this works perfectly for me, in Portrait and Landscape. However, on iOS 8, when I move to Landscape, the status bar gets hidden. I made a change so on rotation, I change the statusBarBackgroundViewMode to MMStatusBarBackgroundViewModeNone for Landscape and MMStatusBarBackgroundViewModeVariable for Portrait. If I have the drawer hidden, rotate and show it, this works perfectly. The problem is when the drawer is opened and the device rotates: In Landscape, the status bar is hidden properly, and all is well. Any ideas how I could fix this? |
Yup, I tested the demo in the iOS8 simulator and it's really broken. In iOS8 there are some changes regarding orientation and rotations, it might have something to do with that. I'll look into it over the weekend. |
Hey @pedroscocco, any luck in finding a solution for the problems with iOS 8? |
This change creates 3 possible states for the status bar background view.
MMStatusBarBackgroundViewModeNone
: The same asshowsStatusBarBackgroundView
set to NO.MMStatusBarBackgroundViewModeOpaque
: The same asshowsStatusBarBackgroundView
set to YES.MMStatusBarBackgroundViewModeVariable
: In this mode, the background view only appears when the drawer is open, with an alpha animation when closing and opening. This mimics the behaviour of the facebook app when opening the contacts drawer.I Created 2 methods,
showsStatusBarBackgroundView
andsetShowsStatusBarBackgroundView:
, for backwards compatibility, so this change doesn't break working apps.Also changed the example app to demonstrate this new feature.