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 05:57, 4 October 2012 by hamishwillee (Talk | contribs)

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

Changing display orientation in Symbian Web Runtime

From Wiki
Jump to: navigation, search

This code snippet shows how to change the orientation of the display to "Portrait" or "Landscape".

Article Metadata
Code ExampleTested with
Devices(s): Nokia 5800 XpressMusic, Nokia 6220 Classic
Platform(s): S60 5th Edition, S60 3rd Edition FP2
S60 5th Edition
S60 3rd Edition FP2
Keywords: widget.setDisplayPortrait(), widget.setDisplayLandscape()
Created: ivruban (26 Feb 2009)
Last edited: hamishwillee (04 Oct 2012)


Source file: Relevant HTML components

<input type="button" value="Landscape" onclick="changeToLandscape();" />
<input type="button" value="Portrait" onclick="changeToPortrait();" />

Source file: JavaScript file

// Changes the orientation to landscape
function changeToLandscape() {
if (window.widget.isrotationsupported) {
} else {
alert("Display rotating is not supported.");
// Changes the orientation to portrait
function changeToPortrait(){
if (window.widget.isrotationsupported) {
} else {
alert("Display rotating is not supported.");


After starting the widget, the buttons "Landscape" and "Portrait" are shown.

  • To change the display orientation to landscape, click the "Landscape" button.
  • To change the display orientation to portrait, click the "Portrait" button.

Supplementary material

This code snippet is part of the stub concept, which means that it has been patched on top of a template application in order to be more useful to developers. The version of the WRT stub application used as a template in this snippet is v1.1.

This page was last modified on 4 October 2012, at 05:57.
84 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.