Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
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