01-10-2011 05:15 AM
Hello you can use
setStatus(Managers or etc);
to add any manager at the bottom of the screen.
01-10-2011 10:04 AM
FIELD_TOP, FIELD_BOTTOM and FIELD_VCENTER are ignored by VerticalFieldManager, just like FIELD_LEFT, FIELD_LEADING, FIELD_RIGHT, FIELD_TRAILING and FIELD_HCENTER are ignored by HorizontalFieldManager. These managers have their own policy of vertical and horizontal positioning, respectively.
Your solution, therefore, is the most elegant one. Just replace getPreferredHeight() with getHeight() - at that point your footer manager has been laid out just like everything else, so it already knows its actual height.
06-26-2011 02:42 AM
12-01-2011 06:43 PM
04-23-2012 07:40 AM
The solution could be this:
public final class MyScreen extends MainScreen
{
/**
* Creates a new MyScreen object
*/
public MyScreen(){
super(Screen.NO_VERTICAL_SCROLL | Screen.NO_VERTICAL_SCROLLBAR);
// Set the displayed title of the screen
setTitle("Posicionamiento de elementos en la Screen");
VerticalFieldManager containerManager = new VerticalFieldManager(Manager.USE_ALL_WIDTH | Manager.USE_ALL_HEIGHT);
containerManager.setBackground(BackgroundFactory.c
VerticalFieldManager vfm = new VerticalFieldManager();
vfm.setBackground(BackgroundFactory.createSolidBac
vfm.add(new LabelField ("Field 1"));
vfm.add(new LabelField ("Field 2"));
HorizontalFieldManager hfm = new HorizontalFieldManager(Manager.USE_ALL_HEIGHT | Manager.FIELD_HCENTER);
hfm.setBackground(BackgroundFactory.createSolidBac
hfm.add(new LabelField ("Field 3", Field.FIELD_BOTTOM));
containerManager.add(vfm);
containerManager.add(hfm);
this.add(containerManager);
}
}