How to switch orientations in WRT Widget
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:
// Lets change the screen orientation to Landscape.
- Related Web Developer's Library 1.8 entries