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

Support for rotation #7

Open
lammertw opened this issue May 25, 2016 · 7 comments
Open

Support for rotation #7

lammertw opened this issue May 25, 2016 · 7 comments
Assignees

Comments

@lammertw
Copy link
Contributor

Any chance you could add support for rotation while one of the side panels is open? Right now it doesn't reposition the main view.

@vinnyoodles
Copy link
Owner

Yeah, that is definitely something that is needed. I'll start working on that

@vinnyoodles
Copy link
Owner

@lammertw I've looked into this issue and there isn't a way for this pod to support rotation. Rotation support must be handled when initializing the left, center, and right view controllers through the use of constraints. I admit that my example project did not support rotation because I set the frame of the controllers to be the static size when in the portrait orientation. I believe the best solution is to override the view controller's viewWillTransitionToSize method and update the constraints accordingly.

Sorry for the delayed response as well.

@lammertw
Copy link
Contributor Author

lammertw commented Jun 9, 2016

Thanks for the answer. I'll definitely try this.
I also made some changes to handle replacing the left and right view controllers. I'll probably make a pull request for that soon.

@vinnyoodles
Copy link
Owner

Awesome

@lammertw
Copy link
Contributor Author

I've reread your answer with a little bit more focus and I think you might misunderstand what I meant with supporting rotation. The only problem I have is that when you rotate while the left or right view is openen, the main view keeps the same offset. For example, the default offset is 150. If I open the left view in portrait the x position of the main view will be moved to 170 (320 - 150). If I then rotatie the device into landscape, the x position is still 170. Instead I believe it should recalculate 568 - 150 = 418 and then reposition the x from 170 to 418.

I've included some screenshots.
Opened menu in portait:
screen shot 2016-06-12 at 20 52 01

Rotate into landscape:
screen shot 2016-06-12 at 20 52 05

Which should be the same as if the menu is opened from landscape in the first place:
screen shot 2016-06-12 at 20 52 09

And worse is even when rotating from a menu opened in landscape to portrait because then the entire main view is gone:
screen shot 2016-06-12 at 20 52 14

I don't think I can fix this by constraints in my views since the position of the main view is controlled by your library.

@vinnyoodles vinnyoodles reopened this Jun 12, 2016
@vinnyoodles
Copy link
Owner

Hmm, I'm starting to understand your issue now. So you're saying it should update the offset to accommodate the new orientation?

@lammertw
Copy link
Contributor Author

Correct

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

No branches or pull requests

2 participants