Languages

Menu
Sites
Language
How to lock portrait & landscape mode of my application

Hi,

How to lock landscape mode of an application.I have developed an application in which i want to lock landscape mode how can i do this.

thanks and regards

Mohit Kumar

 

Responses

6 Replies
colin Rao

f.y.i.  copy from the IDE help doc. 

  • Locking the screen to a specified orientation

    Locking means that the rendering of the current browsing context is forced to be shown in the specified orientation. The screen remains in the selected orientation state until the lock is removed.

    Lock the screen with the lockOrientation() method.

    The following code snippet demonstrates how to lock the screen to a specified orientation.

    screen.lockOrientation("portrait-secondary");

    The method accepts the following parameter values: portrait-primary, portrait-secondary, landscape-primary, landscape-secondary, portrait, and landscape.

    Note
    When using the screen orientation lock:
    • When the portrait value is used to lock the orientation, the orientation can change between portrait-primary and portrait-secondary. The landscape value behaves similarly.
    • Depending on the browser, unlocking the screen orientation may have no visual effect.
Marco Buettner

I will prefer the way over the config.xml

Check config.xml -> Tizen tab -> Rotation -> Change it from Portrait to Landscape

Alex Dem

Hi,
fyi: Here is ready example how to use lockOrientation api:
http://download.tizen.org/misc/examples/w3c_html5/device/the_screen_orientation_api/screen_orientation.html
Alexey.

Palitsyna

Hello,

you can add <tizen:setting screen-orientation="landscape"/> line in your config.xml file to lock the screen to a landscape orientation.

Seoghyun Kang

Hello,

 

If your application supports the only one screen-orientation, I recommend Palitsyna's way. (Set it at the config.xml)

That's because I sometimes found the bugs when I used "the screen.lockOrientation".

AVSukhov

Hello,

More info about configuration sttings of your app you can find in help doc:

IDE -> Help -> Help Contents