Hello @Mielesplayz ,
If you want to lock the screen orientation in your app, you can set it individually on each platform.
You could open MainActivity.cs under Platforms/Android, then change the the orientation attribute.
[Activity(... ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, ScreenOrientation = ScreenOrientation.Landscape)] //This is what controls orientation, you could force the application orientation to be Landscape or Portrait
You could double-click to open
info.plist file under Platforms/iOS, then find Device Orientation option and set the screen orientation according to your needs.
For more details, you can see Device Orientation - Xamarin | Microsoft Learn (These settings apply to Xamarin and MAUI, even though the documentation is about Xamarin)
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hi @Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) , how can we fix this issue on an app built for Microsoft environment?
thanks in advance
You could open
Package.appxmanifestfile under Platforms/Windows, and check the option of Supported rotations. For further support, you can post a new thread.