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 over the next few weeks. Thanks for all your past and future contributions.

How to support layout switching

From 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.
26 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.