Namespaces
Variants
Actions

How to switch orientations in WRT Widget

Jump to: navigation, search
Article Metadata

Tested with
Devices(s): N97

Compatibility
Platform(s): S60 3rd Edition

Article
Keywords: widget.isrotationsupported, widget.setDisplayLandscape(), widget.setDisplayPortrait()
Created: vasant21 (January, 2nd, 2010)
Last edited: hamishwillee (05 Jul 2012)

WRT Widget orientation switch/rotate can be done using widget.setDisplayLandscape and widget.setDisplayPortrait if widget supports those screen orientations.


API's needed are as below:

isrotationsupported is a read-only property that returns a Boolean value determining if the device supports landscape and portrait screen orientations. If the value is true, the device supports both landscape and portrait screen orientations.


The setDisplayLandscape method changes the orientation of a widget's screen to the landscape mode.


The setDisplayPortrait method changes the orientation of a widget's screen to the portrait mode.


  • Example on switch to Landscape Mode:
if (widget.isrotationsupported){
// Lets change the screen orientation to Landscape.
widget.setDisplayLandscape();
}
  • Related Web Developer's Library 1.8 entries

Designing for dynamic screen orientation

This page was last modified on 5 July 2012, at 06:52.
99 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved