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 5th Edition
S60 5th Edition

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

这篇文章描述了如何通过去掉文本手写防止编辑框滚动时文本被选择而高亮的问题。

在S60第五版这类提供触摸感应的手机,可以通过HandlePointerEventL()方法捕捉触摸事件。可以用来处理上下和拖动的事件。这样CCoeControl派生控件可以通过完成HandlePointerEventL()方法来自定义自己的触摸事件处理。

我们可以通过调用ClearSelectionL()方法来移除选择/高亮的状态。

  • 解决方案

下列代码片段描述了演示了通过去掉文本手写防止编辑框滚动时文本被选择而高亮的问题。

void <ClassName>::HandlePointerEventL(const TPointerEvent &aPointerEvent)
{
//iEditor is a CEikEdwin control
iEditor->ClearSelectionL();
// Call base class HandlePointerEventL()
CCoeControl::HandlePointerEventL(aPointerEvent);
}

下列图片显示了解决前后的状态:

TSS001330 1.jpg

当手写指针放在文本中移动,那么就会从被拖动处开始选择并高亮显示文本。

TSS001330 2.jpg

使用上述代码,该问题将得到修正。

This page was last modified on 7 August 2012, at 00:13.
27 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.

×