I need to divide screen into two parts. In one part开发者_如何学Go I need to display array of text elemnts and in another part some text fields with buttons.
For that I am taking two vertical field managers named as first and second.
In first vertical field manager I am adding the text content like this
VerticalFieldManager ratesScreen = new VerticalFieldManager(FOCUSABLE|VERTICAL_SCROLL|VERTICAL_SCROLLBAR);
ratesScreen.setBorder(ratesScreenBorder);
for(int i=0;i<10;i++){
HorizontalFieldManager hfm = new HorizontalFieldManager();
LabelField years = new LabelField();
years.setText(ratesVector.elementAt(i));
LabelField arm = new LabelField();
arm.setText(ratesVector.elementAt(i+1));
LabelField fixed = new LabelField();
fixed.setText(ratesVector.elementAt(i+2));
hfm.add(gapLabel);
hfm.add(years);
hfm.add(gapLabel1);
hfm.add(arm);
hfm.add(gapLabel2);
hfm.add(fixed);
ratesScreen.add(hfm);
}
And add the second vertical field manager to the status like this.
this.setStatus(screenManager);
It is looking like this
Here the problem is the above vertical field manager is not focusable and not scrollable.
Any ideas on how to resolve?
You can either set your LabelFields as FOCUSABLE
or add NullFields after the LabelField. The reason is that the VFM is saying that it has no Fields that are focusable, so the cursor doesn't get put into it and goes to the first Field that can take focus, your dropdown.
精彩评论