如何将ScrollBar设置为Blackberry中的VerticalFieldManager?

时间:2009-07-17 07:18:06

标签: blackberry

我正在使用此代码将scrollBar设置为Blackberry中的VerticalFieldManager

   VerticalFieldManager temp2=new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL);
   LabelField result=new LabelField("Result \n Result\n Result\n Result \n Result\n");   
   temp2.add(result);

添加labelField并且VerticalFieldManager显示的内容没有滚动。我的代码是否正确?。如果有人有任何想法处理这个,请帮助我。

2 个答案:

答案 0 :(得分:4)

 1. Set VerticalFieldManager style to VERTICAL_SCROLL|VERTICAL_SCROLLBAR    
 2. Add a new NullField(Field.FOCUSABLE) after LabelField

答案 1 :(得分:1)

我的解决方案:

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);