Ypimagepicker: Support for orientation change

Created on 23 Aug 2018  路  5Comments  路  Source: Yummypets/YPImagePicker

Is your feature request related to a problem? Please describe.
Once YPImagePicker view controller is opened and orientation i.e from portrait to landscape is changed the layout doesn't resize and it looks like attached screenshot.

Describe the solution you'd like
It would be perfect to have autolayout that adjust layout to current orientation.
Minimal working solution is to lock orientation in specific view controllers to avoid showing glitched view to end user.

Describe alternatives you've considered
Since YPImagePicker is presented on Navigation View controller I cannot change orientation without messing with YPImagePicker library code.
Since YPImagePicker class is "public", not a "open" class it cannot be subclassed.

Additional context
iphonecamera
iphonelibrary
ipadcamera
ipadlibrary

Bug

Most helpful comment

+1
When i open the Library (landscape mode), i can see the Camera Screen on the right.
how to stay in portrait mode?

All 5 comments

+1
When i open the Library (landscape mode), i can see the Camera Screen on the right.
how to stay in portrait mode?

Hi @Sieniek, @Skyb0rg , the landscape orientation has never been supported so it's "normal" that this fails 馃槃 .
This is something that we might support in the future but in the meantime you'll have to force portrait orientation when showing the picker :)

OK thank you.
I will try this answer:
https://stackoverflow.com/questions/28938660/how-to-lock-orientation-of-one-view-controller-to-portrait-mode-only-in-swift

Or do you have a guide / hint for us?

Thanks

How to lock the picker in portrait mode?

So this is fine, you are free not to support it. However, if you do not want to support landscape, the view controller should tell the os. I fixed my instance by adding the following function to YPImagePicker.swift:

    open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        return .portrait
    }

Without this, the above horrible "half-visible" orientation is what happens.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fukemy picture fukemy  路  6Comments

StackHelp picture StackHelp  路  4Comments

DamascenoRafael picture DamascenoRafael  路  5Comments

uxight picture uxight  路  6Comments

twinkalH picture twinkalH  路  4Comments