OK, I'll try that. But before I do, I need to solve a problem with
scrolling.
On the form, I have two containers, and they each set their size like this:
static final int SIZE = 25; // DIPS ~ 1mm/dip
/**
* sets size of container at top of screen
*/
class MyContainerTop extends Container {
MyContainerTop(Layout s) {
super(s);
}
@Override
public Dimension calcPreferredSize() {
int h = Display.getInstance().convertToPixels(SIZE, false);
Dimension d = super.calcPreferredSize();
d.setHeight(h);
return d;
}
}
/**
* sets size of container at bottom of screen
*/
class MyContainerBottom extends Container {
MyContainerBottom(Layout s) {
super(s);
}
@Override
public Dimension calcPreferredSize() {
int h = MyForm.this.getHeight() - Display.getInstance().
convertToPixels(SIZE, false);
h -= MyForm.this.getToolbar().getPreferredH();
Dimension d = super.calcPreferredSize();
d.setHeight(h);
return d;
}
}
This lays out the top component, which is initially just an empty Container
with a border to which Labels will be added.
The bottom component contains a bunch of buttons and stuff. This all works
fine and renders correctly on different devices. However, as I add Labels,
the top container doesn't scroll - they disappear off the bottom of the
container. A scrollbar momentarily appears but vanishes.
result = new MyContainerTop(new BoxLayout(BoxLayout.Y_AXIS));
result.setScrollableY(true);
result.setUIID("BorderContainer");
form.add(result);
form.add(bottom_container);
What am I doing wrong ?
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/abc6ac0d-dd58-4571-8814-d92def403eca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.