Friday, April 04, 2008

How to start a application in a specific orientation

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 AknAppUi::ConstructL():

void CMyAppUi::ConstructL()
{
BaseConstructL( EAknEnableSkin | EAppOrientationLandscape ); // start in landscape mode
//BaseConstructL( EAknEnableSkin | EAppOrientationPortrait ); // start in Portrait mode
...
}



Note: enums Passed BaseConstructL() are different from enums that are passed to SetOrientationL().

No comments:

stats counter