我正在试着跟踪这个,但没有得到任何运气。我使用的是treeItem或Choicegroup,它可以被选中,但不能被点击,就像点击时,它会转到下一页。
我不想使用X和Y,因为我的项目是动态的,它是通过XML生成的。因此,项目位置将被更改。我想要一个触摸指针为一个特定的项目,如选择组,我正在使用。
http://www.enough.de/products/j2me-polish/documentation/lush-ui/touch-support.html#gesture-click
发布于 2014-05-12 15:44:12
你有Choicegroup,你想要点击项目,它应该转到下一页,然后:你可以使用:
choicegroupname.addCommand(command of Command.OK type, say commandOpen);然后,您可以将setItemCommandListener设置为commandOpen,在commandAction中,您可以遍历choicegroup,这样您就可以获得焦点索引并在那里执行代码,然后break.Hope这会有所帮助。
您可以这样做:
commandOpen.setItemCommandListener(new ItemCommandListener() {
public void commandAction(Command cmd, Item arg1) {
//size will be count of items
for(int i=0 ; i < size ; i++){
if(choicegroupname.focusedIndex== i){
//Do your code
return;
}
}
}
});https://stackoverflow.com/questions/12776651
复制相似问题