| ID | TSS001178 | Creation date | November 26, 2008 |
| Platform | S60 3rd Edition S60 3rd Edition, Feature Pack 1 S60 3rd Edition, Feature Pack 2 | Devices | All (S60 3rd Edition) |
| Category | Symbian C++ | Subcategory | UI, UI Components |
| Keywords (APIs, classes, methods, functions): KEikDynamicLayoutVariantSwitch |
Support for changing the application orientation between portrait and landscape modes can be added by implementing the HandleResourceChangeL() function in the App UI class and reacting to events of type KEikDynamicLayoutVariantSwitch.
Switching between display modes can cause visible UI problems in dialog-based applications (applications using a CEikDialog or CAknDialog-derived class as their main UI) if the dialog is not made aware of the change.
When receiving this type of event in a dialog-based application or when any custom dialog is being displayed, that event should also be forwarded to the active dialog to ensure that it has the correct layout also after the orientation switch:
void CMyDialogBasedAppUi::HandleResourceChangeL( TInt aType )
{
// First call base class implementation
CAknAppUi::HandleResourceChangeL( aType );
if ( aType == KEikDynamicLayoutVariantSwitch )
{
if ( iDialog )
{
TRect rect;
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect );
iDialog->SetRect( rect );
'''iDialog->HandleResourceChange( aType );'''
}
}
}
No related wiki articles found