Skip to content
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

Showing Date Selector from iPhone landscape mode - window shaped incorrectly #39

Closed
AnthonyMDev opened this issue Nov 18, 2014 · 7 comments

Comments

@AnthonyMDev
Copy link

When I put my phone in landscape orientation and then show the date selector, it shows up in the middle of the view and it's cut-off, only showing a portion of the selector.

It works fine if I show the selector in portrait and then turn the device to landscape, but not if I show the selector from in landscape mode.

@CooperRS
Copy link
Owner

Are you using an iPhone 6/6+? This issue may be related to this one: CooperRS/RMPickerViewController#14

@AnthonyMDev
Copy link
Author

Yes, I am. Odd, that issue isn't showing up in the issues list for me, but the link works just fine.

But thank you, I'm glad to hear this is being fixed! Let me know if I can be of any help.

@CooperRS
Copy link
Owner

To be honest, I have no clue how to fix this :/

RMDateSelectionViewController uses an additional UIWindow to show the date selection view above all other views. If I do not use an additional UIWindow and instead add the picker view controller to the current view hierarchy, the swipe gesture of UINavigationControllers to go back, is still enabled and messes up everything. See: #28

So, I'll need an additional UIWindow. Then I want to support rotation. But when a UIWindow auto rotates, it shows a black background hiding everything behind it. That's not what I want, so I have to disable rotation of a UIWindow and handle it myself (done by setting the root view controller of the additional UIWindow which returns NO on shouldAutoRotate).

That's why I'm setting the frame of an UIWindow when showing the date selection view and when rotating. This works on iOS 7 and 8 on all devices. Except for the iPhone 6/6+. On these devices something weird is done when setting UIWindow frames.

Maybe, someone can help me out?

@steveoleary
Copy link

It seems this issue is resolved (at least for me) by including my storyboard file in 'Launch Screen File' under App Icons and Launch Images. You can use a .nib file in it's place if you don't have a storyboard. I got the clue from here

http://stackoverflow.com/questions/26030420/iphone-6-orientation-transform-issue-uiwindow-object

So i guess this comes under the realm of iOS bug?

Really nice control btw, thanks

@CooperRS
Copy link
Owner

So i guess this comes under the realm of iOS bug?

Seems to be related to the question whether or not an app is optimized for iPhone 6/6+. My demo project was not optimized. If you add a Launch Screen file it is optimized. The control also works as expected when you add a good old Default.png of the right size. In this case the app is treated as an optimized app, too.

Thanks for your help!

@AnthonyMDev
Copy link
Author

I'm going to be testing this in a project shortly. If it works I'll let you know and mark it as closed! 👍

@AnthonyMDev
Copy link
Author

Just tested this, and you are correct. Everything seems to work! The animation for changing orientations while the date selection controller is open is a tiny bit lag on my iPhone 6 Plus, but I don't think there is much that we can do about that. It's a complex animation.

Great job on this library! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants