0

我是一名同时在 android 上工作的新 BB 开发人员,我正在准备一个项目,其中包含两种语言的列表和对象选择字段。

在黑莓中,我有一个包含 10 个元素的列表,在每个元素行上,我需要在单击该按钮时显示一个箭头按钮,一个 ObjectChoiceField 将弹出。

在这里,很明显 list 和 obejctchoice 字段都是自定义的。

我很困惑,请让我知道,这是如何实现的。

提前谢谢..!:|在此处输入图像描述

4

1 回答 1

1

// 自定义 ListField 如何在 BlackBerry 中自定义 ListField?

要获得点击的项目,只需将以下函数添加到代码中

protected boolean navigationClick(int status, int time) {
        Field field = this.getLeafFieldWithFocus();

        if(field instanceof ListField){
            System.out.println("navigationClick Yes Yes you clicked list item ");
            ListField listField = (ListField)field;
            // this will give you clicked index.
                    int index = listField.getSelectedIndex();
            // pop up your Object choice field here...
        }
        return true;
} 
于 2012-05-14T11:39:26.543 回答