如何火黑莓列表场项目内不同领域的事件 [英] how to fire an event for different fields inside list-field item in blackberry

查看:427
本文介绍了如何火黑莓列表场项目内不同领域的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个应用程序,我需要使用列表场。内每个列表场项,有三个字段:

I am developing an application where I need to use list-field. Inside each list-field item, there are three fields:

图片文字图片

如果我点击列表场项目显示的菜单。但我不希望被选中整个列表字段项排,当用户点击该行。我想列表场项目的一部分,强调了 - 如果我点击要执行的第一个图像一个动作,如果我的文字后,点击最后的图像应进行其他操作。现在,无论我点击正在执行相同的操作列表场项目。我不希望它。我想每个列表场项目内不同领域的单独的操作。

If I click on the list-field item a menu is displayed. But I don't want the whole list field item row to be selected when the user clicks the row. I want a part of the list-field item highlighted -- if I click the first image one action should be performed, and if I click the last image after the text another action should be performed. Now wherever I click on the list-field item same action is being performed. I don't want it. I want separate actions for different fields inside each list-field item.

推荐答案

您可以自定义ListField做你想要什么。请记住,ListField不会对各行分开Field对象 - 它只是绘制整个行一次,并且您提供的paint方法来做到这一点。所以,你的心智模型似乎有些不正确的,因为你在想这些的领域。

You can customize ListField to do what you want. Keep in mind that ListField does not have separate Field objects on each row - it just draws the entire row at once, and you provide the paint method to do it. So your mental model appears to be somewhat incorrect, since you are thinking of these as fields.

您将需要覆盖的重点行为和触控板的运动。然后你就可以绘制每一行与列表项的相应部分的重点。你必须来管理自己。

You will need to override the focus behavior, and the trackpad movement. Then you can draw each row with the appropriate part of the list item focused. You will have to manage that yourself.

如果您支持触摸设备,你也将需要处理的触摸事件,找出该行的一部分被感动了。

If you are supporting touch devices, you will also need to handle touch events, to figure out what part of the row was touched.

这篇关于如何火黑莓列表场项目内不同领域的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆