How to set a ScrollBar to the VerticalFieldManager in Blackberry?

放肆的年华 提交于 2019-12-29 05:35:11

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!