locked
View orientation problem

    Question

  • I have asked about this in the past but have not gotten a good answer.  However, I thought I had the issue resolved, but I am finding that on certain devices, it is not.

    I have an app which has certain pages which are best viewed in portrait.  On a tablet, I want to automatically switch to portrait, and on a desktop PC or laptop, I do not. 

    I have previously solved this by changing the 'DisplayProperties::AutoRotationPreferences' to allow for only Portrait (or PortraitFlipped) when I want portrait.  I found that if I do this on devices which do not support portrait, that the display remains landscape (which is what I want).

    However, I now have a laptop which has a touch screen and when I make the above call, it switches to portrait (even though the rotation lock is on).  This is quite undesirable.  Will this be true for all laptops that have touch screens?  Is there some way to know that the device has an attached keyboard and cannot really be conveniently rotated?

    Thanks.
    Sunday, September 1, 2013 9:22 PM

All replies

  • Is your laptop a convertible of some kind?

    I believe there is some setting (in the registry?) that tells Windows if the device has a fixed orientation or not, and maybe your laptop is misreporting this (maybe even the graphics driver?).

    That aside, my recommendation is to never force a screen orientation change on the user. Let them decide what is the best way to view your app. As a user, I do not want apps to *ever* force me to turn my tablet unless that app is designed only for a specific orientation (and in my opinion that should only be landscape on Windows 8/RT).


    I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.

    Monday, September 2, 2013 8:03 AM
  • No, it is not convertible.  By default, the 'lock orientation' option is set and the screen does not rotate when you rotate the laptop.  However it still allows me to rotate it programatically.  What I want is that if the user has it set to not rotate, that it doesn't rotate (which is what happens on desktop devices and other laptops that I have tried).

    I get what you are saying about not switching automatically, but the only page that I can display in portrait is the page in question, so the app cannot be set to auto rotate to portrait.  I am thinking that I am simply going to need to put in an option that the user can set which will allow the page to switch orientation.  This is not optimum, but it is the best I can come up with.

    Friday, September 6, 2013 8:35 PM