Tag: listfield

自定义列表字段单击事件

即时编写一个应用程序,我已创建自定义列表字段用于显示列表视图。 我的CustomListField包含一行中的一个图像和文本。 im gettiing字段更改监听器点击listfield行但我想把fieldchange监听器放在图像上..任何人都可以告诉我该怎么做。 这是我的代码。 public class CustomListField extends ListField implements ListFieldCallback { private Vector _listData; private int _MAX_ROW_HEIGHT = 60; public CustomListField(Vector data) { _listData = data; setSize(_listData.size()); setSearchable(true); setCallback(this); setRowHeight(_MAX_ROW_HEIGHT); } protected void drawFocus(Graphics graphics, boolean on) { XYRect rect = new XYRect(); graphics.setGlobalAlpha(150); graphics.setColor(Color.BLUE); getFocusRect(rect); drawHighlightRegion(graphics, HIGHLIGHT_FOCUS, true, rect.x, rect.y, rect.width, rect.height); […]