Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable portrait mode in Windows 8?

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

like image 421
Adrian Grigore Avatar asked Jun 29 '12 11:06

Adrian Grigore


People also ask

How do I turn off Windows portrait mode?

Right-click the Desktop, then select Display settings. Under Display, switch Lock rotation of the display to off to lock the auto-rotation.

How do I turn off auto rotate on Windows 8?

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.

Why is my laptop in portrait mode?

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.


2 Answers

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

like image 127
Paul O. Avatar answered Oct 17 '22 02:10

Paul O.


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;
like image 42
MVarman Avatar answered Oct 17 '22 03:10

MVarman