-
Notifications
You must be signed in to change notification settings - Fork 21
Is there any way to prevent the orientation change? #13
Comments
Hi @kxgonzalez , were you able to fix this? |
Hi @kxgonzalez Try to use
|
@wcoder - |
Currently, there is no such functionality. But you can setup platform manifests "supported device orientation" https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/device-orientation?tabs=vswin |
Yes, but that would set it on a complete application, right? I want to set only horizontal orientation on a specific screen. |
I'm in the same situation. |
Currently, this plugin supported lock of device orientation only for one direction. This situation (more than one direction) will good enhancement for next version of the plugin. I can propose the workaround for yours: Manual override these methods on each platform: Android
public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig) {} iOS
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, UIWindow forWindow){} In these methods, you can lock the device orientation for the required page. |
Nice, thank you! |
Hi,
I want to prevent the app to be rotated to portrait mode in certain scenarios, but I need it available so I can't disable it completely.
I know we have the OrientationChanged event but it fires after the orientation changes.
In other words; I want the app to be available in landscape and landscape flipped mode.
How can I achieve this?
I'm currently using Xamarin.Forms with PCL.
The text was updated successfully, but these errors were encountered: