views:

661

answers:

2

Hi,

I am beginning in Blackberry development. I want to add two fields in a vertical field manager. I want the first one to be align on the left and the second one (on the second line) on the right. I don't find a simple answer to this question.

Thanks a lot.

+3  A: 

You can use the style argument of the field constructor to specify alignment, both horizontal and vertical.

    VerticalFieldManager titlevfm = new VerticalFieldManager();
    LabelField leftField = new LabelField("my label", Field.FIELD_LEFT);
    LabelField rightField = new LabelField("right field", Field.FIELD_RIGHT);
    titlevfm.add(leftField);
    titlevfm.add(rightField);
JustinD
The VerticalFieldManager should be defined with style value USE_ALL_WIDTH.
Fostah
A: 

You can also create a class that extends Manager class Override the sublayout method and place contents as per your choice

SWATI