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.

CAknView::ClientRect()返回错误的绘制区域

From Wiki
Jump to: navigation, search
Article Metadata

文章
huwell 在 14 Jan 2008 创建
最后由 hamishwillee 在 15 Dec 2011 编辑
  • 开发伙伴平台:

S60 2nd Edition and FP1, FP2, FP3


  • 详细描述

CAknView完成了它自己的ClientRect()方法,一般用来设置控件的大小,这些都是由view来管理的。在某些情况下CAknView::ClientRect()返回的区域高度是错误的,这主要发生在资源文件中同时定义了应用程序级的CBA和某个view的CBA的情况下。


从而导致程序绘图区域中减掉两次control pane。这样CAknView::ClientRect()返回的区域高度就太小了。


  • 如何重现

我们可以通过编译S60第二版SDK FP3中的示例multiviews来查看这个错误:

在multiviews.rss中,在EIK_APP_INFO定义中增加一个CBA定义。

RESOURCE EIK_APP_INFO
 
{
 
cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
 
}


然后编译并运行这个示例,你就会看到错误所在。


  • 解决方法

我们只需要定义一个基于view的CBA,而不需要在EIK_APP_INFO资源中再定义另一个(例如可以用main view的CBA来代替它)


另一个解决方法是在构造view时同时传递一个AppUi的引用,从而使用CEikAppUi::ClientRect()来替换CAknView::ClientRect()即可。

This page was last modified on 15 December 2011, at 06:42.
350 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.

×