-
Notifications
You must be signed in to change notification settings - Fork 27k
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
setPreferredOrientations not working in iPad #27235
Comments
Might be #13238 |
Thanks @zoechi , I did read that thread before creating a new issue here. However that is related to automatically setting orientation and mine one is a bug which only occurs in iPad. |
Rotating like mentioned in #13238 also does not fix the orientation on your iPad? |
@zoechi Yes, it doesn't lock the orientation. I can rotate from landscape to portrait and vice versa for the whole day. As I said before, it works as expected in iPhone. |
I manage to fix that problem with this: First, add this code to the appDelegate.swift in the Runner project
Second Check that "Requires full screen" is enabled under Targets->Runner->Deployment info
|
@SergioBernal8 Thanks for your solution, I haven't tried it yet though, but I want Flutter team to solve the bug instead of any workaround. |
+1 |
@sjoenk Please show your +1 support by putting a thumbs up to the issue, that adds more priority to the issue. |
That actually fixed it for me. Only thing is that i now have to run my app in fullscreen. That's fine for my use case but could be annoying for others. |
We fixed it by setting UISupportedInterfaceOrientations in Info.plist in our case, setting both to
resulted in all iOS devices remaining in portrait mode. |
@dark-chocolate i also noticed this behavior lately and did some additional research: All iPad apps that support multitasking need to support all interface orientations (check this apple guide). As it seems, the only way to restrict interface orientations for iPad is to opt out of multitasking completely as described above ( Set "Requires full screen"). After opting out, the app will not support Slide Over and Split View multitasking anymore. From my perspective, this is not a Bug but the documentation could possibly be improved. Might make sense to add some information about this behavior here |
@josh-ksr Thank you so much for sharing this, you're right it's not a bug, and Flutter team should update documentation regarding this. Once they do, they can close this issue. |
Docs were updated by #40743. |
just need to check "full screen" option after
works as expected, and can be dynamically changed. |
@dark-chocolate did you fix the problem?i'm using ipad too,can't lock orientation. |
I've finally fixed it by manually editing the Open it with a text editor and change the supported orientation values you find with those:
The first block is for iPhone, the second one for iPad (this will block the multitasking) |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to reproduce:
You can still rotate your iPad. However it works fine in iPhone.
Flutter Doctor
The text was updated successfully, but these errors were encountered: