问题
I am using this code to set the scrollBar to the VerticalFieldManager in Blackberry
VerticalFieldManager temp2=new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL);
LabelField result=new LabelField("Result \n Result\n Result\n Result \n Result\n");
temp2.add(result);
The labelField is added and the contents are displayed by the VerticalFieldManager is not getting scrolled.Is my code is correct?.If anyone have any idea to handle this please help me.
回答1:
1. Set VerticalFieldManager style to VERTICAL_SCROLL|VERTICAL_SCROLLBAR
2. Add a new NullField(Field.FOCUSABLE) after LabelField
回答2:
My solution:
VerticalFieldManager temp2=new VerticalFieldManager(Manager.VERTICAL_SCROLL);
LabelField result=new LabelField("Result \n Result\n Result\n Result \n Result\n",FOCUSABLE);
temp2.add(result);
VerticalFieldManager temp=new VerticalFieldManager();
temp.add(temp2);
add(temp);
来源:https://stackoverflow.com/questions/1141812/how-to-set-a-scrollbar-to-the-verticalfieldmanager-in-blackberry