我已將兩個列表字段添加到屏幕 ,但在焦點更改時,它不會水平轉到第二個列表。焦點在ListField中?
class TestScreen extends MainScreen {
private final ObjectListField listField = new ObjectListField(FIELD_LEFT)
{
public void layout(int width, int height)
{
super.layout(width,height);
setExtent(Display.getWidth()/2, Display.getHeight());
}
};
private final ObjectListField listField2 = new ObjectListField(FIELD_RIGHT)
{
public void layout(int width, int height)
{
super.layout(width,height);
setExtent(Display.getWidth()/2, Display.getHeight());
}
};
private final String[] lines = { "Line 1", "Line 2", "Line 3", "Line 4", "Line 5", "Line 6" };
private final String[] lines2 = { "Line 10", "Line 20", "Line 30", "Line 40", "Line 50", "Line 60" };
TestScreen()
{
super(NO_VERTICAL_SCROLL);
HorizontalFieldManager hfm=new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL);
hfm.add(listField);
hfm.add(listField2);
listField.set(lines);
listField2.set(lines2);
add(hfm);
}
}
我想重點FRIM列表1至列表2水平移動上。
你能提供一個簡短的代碼片段嗎? – 2010-10-14 14:12:44