Blackberry Field alignment in a VerticalFieldManager

别来无恙 提交于 2019-12-13 18:06:43

问题


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.


回答1:


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);



回答2:


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



来源:https://stackoverflow.com/questions/1486664/blackberry-field-alignment-in-a-verticalfieldmanager

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!