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. Thanks for all your past and future contributions.

Archived:Switching application UI orientation between landscape and portrait using Symbian C++

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Platform(s): S60 3rd Edition
S60 3rd Edition, FP1
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Created: User:Technical writer 2 (04 Jun 2007)
Last edited: hamishwillee (14 Jun 2012)


Switching application UI orientation between landscape and portrait


By default, applications are started in the current orientation of the device screen.
In order to force an application to be started in landscape mode or portrait mode, a corresponding flag needs to be passed to the BaseConstructL() function in CAknAppUi::ConstructL():
    void CMyAppUi::ConstructL()
        BaseConstructL( EAknEnableSkin | EAppOrientationLandscape );    // start in landscape mode
To change the orientation while the application is running, call
    void CAknAppUiBase::SetOrientationL( TAppUiOrientation aOrientation );
with either EAppUiOrientationLandscape or EAppUiOrientationPortrait as a parameter. Note that these are not the same enumeration values as those passed to BaseConstructL().

This page was last modified on 14 June 2012, at 07:37.
51 page views in the last 30 days.