Namespaces

Variants
Actions

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.

Revision as of 03:52, 5 July 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to switch orientations in WRT Widget

From Wiki
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 03:52.
39 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×