How to switch orientations in WRT Widget
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:
- [Boolean] window.widget.isrotationsupported
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.
- [void] window.widget.setDisplayLandscape(void)
The setDisplayLandscape method changes the orientation of a widget's screen to the landscape mode.
- [void] window.widget.setDisplayPortrait(void)
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


(no comments yet)