locked
how to lock the orientation of the metro app based on HTML/JavaScript/Css

    General discussion

  • I was developing a simple app that I'd like to made it always follow the orientation landscape .

    That means no matter how you place the surface(or any other WIN8 portable device ), the orientation won't change to fit the different situation.

    I don't know whether I have explain the issue clearly, my English is not so good. Please ask me if you doesn't understand.

    Wednesday, December 12, 2012 12:14 PM

All replies

  • I think I know:

            Windows.Graphics.Display.DisplayProperties.autoRotationPreferences = Windows.Graphics.Display.DisplayOrientations.landscape;

    Wednesday, December 12, 2012 12:40 PM
  • Actually, you can achieve this with just a couple clicks by editing your appxmanifest file in your solution.

    Open up Solution Explorer in Visual Studio after opening your project and then look in your project files for package.appxmanifest if you double click to open that file, on the Application UI tab you'll see a section towards the top for Supported rotations. You could just check off landscape there and leave the others unchecked.

    Wednesday, December 12, 2012 4:06 PM
  • you can specify the supported orientations for you app in app manifest file
    Thursday, December 13, 2012 8:57 AM