這裏是我的代碼:形式不能滾動時包含列表LWUIT
public Form getMenuForm()
{
if (menuForm == null)
{
Form menuForm = new Form("Tracking Main Menu");
menuForm.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
menuForm.setScrollable(true);
menuForm.setScrollableY(true);
menuForm.addComponent(this.getMenuList());
for(int i=0;i<30;i++)
{
Label lblTest = new Label("hello guys");
menuForm.addComponent(lblTest);
}
menuForm.addCommand(new Command("Exit"));
menuForm.setTransitionOutAnimator(CommonTransitions.createSlide(CommonTransitions.SLIDE_HORIZONTAL, true,
200));
menuForm.addCommandListener(this);
}
return menuForm;
}
public List getMenuList()
{
String[] menuItems = { "Find Person", "Person Registration", "Message", "Setting" };
if (menuList == null)
{
menuList = new List(menuItems);
menuList.setListCellRenderer(new DefaultListCellRenderer(false));
menuList.setSmoothScrolling(true);
menuList.setFixedSelection(List.FIXED_NONE);
menuList.addActionListener(this);
}
return menuList;
}
我只能選擇列表中的4個選項,我不能向下滾動查看屏幕的底部。難道我錯過這裏的東西,請大家幫我...
我已經做到了:) – user2010313