BlackBerry UI field managers are known to be annoying when working with field alignment. Managers seem to ignore all style flags (eg HCENTER, VCENTERetc.) Therefore, the only way to do it - to redefine a method sublayoutin your manager and do it yourself.
, , . , , , , .
VerticalFieldManager mainmanager = new VerticalFieldManager(Field.USE_ALL_WIDTH | Field.USE_ALL_HEIGHT)
{
protected void sublayout( int width, int height ) {
super.sublayout( width, height );
width = getWidth();
height = getHeight();
for (int i = 0;i < this.getFieldCount() - 1; i++)
{
Field field = this.getField(i);
int x = (int)((width - field.getWidth()) * 0.50);
setPositionChild(field, x, field.getTop());
}
}
, USE_ALL_WIDTH USE_ALL_HEIGHT . , , .., . , x , y - .
(, , ), sublayout, , .
, .:)