Namespaces

Variants
Actions

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.

切换基于对话框程序的方向

From Wiki
Jump to: navigation, search
Article Metadata

兼容于
平台: S60 3rd Edition, S60 3rd Edition FP1, S60 3rd Edition FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)

文章
翻译:
hoolee
最后由 hamishwillee 在 06 Aug 2012 编辑
  • 详细描述

我们可以通过实现AppUI类中的 HandleResourceChangeL() 支持切换程序在横竖屏之间切换方向,并通过

KEikDynamicLayoutVariantSwitch来响应事件请求。

在不同显示模式中切换,可能会引起基于对话框应用程序(那些从CEikDialog或CAknDialog派生的类)的现实问题——主要是当他们没有对此变化做出响应时。

  • 解决方案

当基于对话框应用程序或任何自定义对话框获取此类事件后,这些事件将传递到前面活动对话框,以便切换时进行正确的方位

显示。

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 );'''
}
}
}
This page was last modified on 6 August 2012, at 06:39.
126 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.

×