我的屏幕上有 5 个字段。我在 9300 而不是触摸设备上工作
-------- ---------
1 2
-------- ---------
------------------------
3'/3''
-------------------------
4
------------------------
我希望当我单击字段 1 时,焦点将更改为字段 3',如果我单击字段 2,焦点将更改为字段 3''。当我单击向下按钮时,焦点变为字段 4。
我所知道的重点是字段 1,然后是 2,然后是 3''。我无法访问字段 3' 或传递到字段 4。如何对字段的焦点进行排序谢谢
焦点
在字段中的传输顺序通常由将它们add()
到其包含Manager
的顺序决定。
您没有完全指定所有转换应如何工作,但类似这样的东西可能会起作用:
public void MyManager(long style) {
super(style);
Field one = new LabelField("hello");
Field two = new BitmapField(image);
Field threePrime = new EditField("");
Field threeDoublePrime = new EditField("");
Field four = new LabelField("goodbye");
add(one);
add(threePrime);
add(two);
add(threeDoublePrime);
add(four);
}
如果你想要比这更复杂的东西,你可以在自定义Manager
子类(包含这五个Field
对象的Manager
)中覆盖navigationMovement(int,int,int,int)
。
有关该技术的信息,请参阅此帖子。