Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
RockAlmeida
Posts: 68
Registered: ‎03-15-2011
My Device: 9630
Accepted Solution

How to make a LabelField right align when the text is long?

In order to make a right aligned LabelField, I create the LabelField with style "FIELD_RIGHT" and add it to a VFM, it works when the text can be displayed in one line. But when the text is long than one line, it doesn't work well.

 

For example, if text is "AAAAAAAAAAAAAAAA BBBBBBBBBBBBBBBBB", it displays like this:

LabelField.png

looks like left aligned

 

How can I get this?

LabelField_Wanted.png.

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to make a LabelField right align when the text is long?

No guarantees, but instead of Field.RIGHT, try

FIELD.USE_ALL_WIDTH | DrawStyle.RIGHT

Regular Visitor
abey350
Posts: 1
Registered: ‎01-02-2012
My Device: developer

Re: How to make a LabelField right align when the text is long?

[ Edited ]

DrawStyle.RIGHT doesnt seem to work with BasicEditField.. any idea how to achieve this?