I am trying to create MainScreenwith vertical scroll. From what I read in the documentation, it MainScreenhas VerticalManagerinside, so it should be possible to allow vertical scrolling only with the appropriate design, i.e.
super(MainScreen.VERTICAL_SCROLL | MainScreen.VERTICAL_SCROLLBAR);
However, this does not work for me. I create a screen by adding a pair LabelFieldand no scrollbars, without scrolling. I am testing on 8900, OS 5.0.
Here is the code I'm using:
public class ExampleScreen extends MainScreen {
public ExampleScreen() {
super(MainScreen.VERTICAL_SCROLL | MainScreen.VERTICAL_SCROLLBAR);
create();
}
private void add(String text) {
add(new LabelField(text));
}
private void create() {
add("line 0");
add("line 1");
...
etc
...
}
}
Question: Am I doing something wrong? Is there a way to enable vertical scrolling with MainScreenor do I need to create one VerticalManagermyself?
source
share