locked
How to align controls based on device rotation? RRS feed

  • Question

  • Hi All,

    Am developing windows App for tablets and mobile devices., How do i align my controls automatically if the devices is totated +/-90 degrees?

    I mean how do i support both landscape and portrait view in my app?

    am using VS2013

    When i was using VS2012 there was a recording option where in i can able to record the controls position based on rotation and save it.

    But with VS2013 am unable to find that recording option.

    can anyone please help me in achieving  this.


     


    Arjun


    Tuesday, December 10, 2013 12:42 PM

Answers

  • You can do the same sort of thing: handle window resize events, check if the height is greater than the width or vice versa, and switch between Portrait and Landscape states. The app should care less about the orientation of the device than of its window: it may be portrait because the use rotated the screen or because the user set the screen to half of the device.

    See Quickstart: Designing apps for different window sizes

    • Marked as answer by Anne Jing Wednesday, December 18, 2013 2:35 AM
    Tuesday, December 10, 2013 4:16 PM
    Moderator