Join Now
Quality Rating:
  • Currently 5.0 / 5
(5.0 / 5 - 1 vote cast)
This page was last modified 10:41, 9 April 2008.

Change screen orientation of UI application

From Forum Nokia Wiki

The following example shows how to change the screen orientation of an S60 UI application, from portrait to landscape or vice versa.



The method that is used to do the rotation is CAknAppUiBase::SetOrientationL(). There is also another method to get the current screen orientation, CAknAppUiBase::Orientation().

The following example shows a method that will change the orientation to portrait if the current one is landscape and vice versa.

void CMyClass::RotateMe()
    {
    // Changing from portrait to landscape or vice versa.
    iIsPortrait = !iIsPortrait;
 
    // Change the screen orientation.
    if (iIsPortrait)
        {
        AppUi()->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait);
        }
    else
        {
        AppUi()->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape);
        }
    }


Internal links

External links

 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX