黑莓上的焦点字段

时间:2012-06-27 21:01:26

标签: blackberry focus

我的屏幕上有5个字段。我在9300上工作而不是触控设备

--------       ---------
   1              2
--------       ---------
------------------------
            3'/3''
-------------------------
            4
------------------------

我想在单击字段1时焦点更改为字段3',如果单击字段2,焦点将更改为字段3''。当我单击向下按钮时,焦点会变为字段4。

我所知道的焦点是在第1场然后是2比3'。我无法访问字段3'或传递到字段4。 如何订购字段的焦点 感谢

1 个答案:

答案 0 :(得分:0)

焦点通过字段传输的顺序通常取决于您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子类中override navigationMovement(int,int,int,int)(包含这五个Manager对象的Field)。

See this post for information about that technique.