rim:orientation element

Syntax

<rim:orientation mode="string"/>

Description

The <rim:orientation> element specifies the orientation for screens in your BlackBerry WebWorks app. This element is optional.

For BlackBerry smartphones apps running BlackBerry 7 or earlier, this element is available with BlackBerry WebWorks SDK 2.3 and later.

Compatibility note

If you port your app to BlackBerry 10, you will need to use the <param> element instead.

Parent elements

<widget>

Child elements

None

Occurrences

Zero or one

Modes

You can specify one of the following values for the mode attribute:

Mode Description
auto

The auto mode specifies that screen orientation changes according to the orientation of the BlackBerry device.

By default, if you do not specify the rim:orientation element, do not specify it with any attribute, or specify it incorrectly, the orientation is set to auto.

portrait

The portrait mode specifies that screen orientation remains in portrait mode, regardless of the orientation of the device.

landscape

The landscape mode specifies that screen orientation remains in landscape mode, regardless of the orientation of the device.

north

The north mode specifies that the screen locks to an orientation where the top of the app is aligned to the physical top of the device (for example, the "top" on BlackBerry smartphones is typically where the speaker is located).

This mode is available only in BlackBerry WebWorks SDK for Smartphones 2.3 and later.

Example: Specifying a screen orientation

<rim:orientation mode="portrait" />

Last modified: 2013-10-02