How to support layout switching

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Created: _stranger (24 May 2007)
Last edited: hamishwillee (25 Jul 2012)

To make your application layout-aware and support orientation switching initiated by window server, you need to override the method CCoeControl::HandleResourceChange() in your containers


void CMyContainer::HandleResourceChange( TInt aType )
CCoeControl::HandleResourceChange( aType );
// application layout change request notification
if ( aType == KEikDynamicLayoutVariantSwitch )
// reconstruct controls if needed
// apply new appropriate rect
TRect rect;
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect );
SetRect( rect );

You can also override CEikAppUi::HandleResourceChangeL(), but this is typically of no use, as re-layouting logically belongs to the containers

This page was last modified on 25 July 2012, at 23:38.
18 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.