I have developed a XAML / C# Windows 8 app which does not support portrait mode. I've opened the Package.appxmanifest in Visual Studio and disabled the the portrait and portrait-flipped mode under "supported rotations". This Created the following rotations preferences:
<InitialRotationPreference>
<Rotation Preference="landscape" />
<Rotation Preference="landscapeFlipped" />
</InitialRotationPreference>
However, when I start my app in the simulator and rotate the simulator, the app still gets rotated in to portrait mode. how can I prevent this from happening?
Thanks,
Adrian
Right-click the Desktop, then select Display settings. Under Display, switch Lock rotation of the display to off to lock the auto-rotation.
Turn Auto-rotate on or off using the Screen Resolution option. Right click anywhere on the desktop. In the menu that pops up click on "Screen Resolution." In the new window, check or uncheck the "Allow the screen to Auto-rotate" to turn Auto-rotate on and uncheck the box to turn it off.
Hit CTRL+ALT+Up Arrow and your Windows desktop should return to landscape mode. You can rotate the screen to portrait or upside-down landscape by hitting CTRL+ALT+Left Arrow, Right Arrow or Down arrow.
The simulator in Windows 8 does not seem to respect your rotation preferences. Unfortunately, there is no way to tell if these settings work as expected until connecting to an actual tablet running Windows 8.
Check out this article for some more information, straight from MSDN: http://msdn.microsoft.com/en-us/library/windows/apps/windows.graphics.display.displayproperties.autorotationpreferences
Just in case someone didn't notice the compiler warning, DisplayProperties is obsolete now. The new way of setting AutoRotationPreferences is,
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With