Android Question How to center Multiline BBLabel text

mscientist33

Active Member
Licensed User
I have found ways to center multiline items but not a Multiline BBLabel. If the text is more than one line I need it to center the second line also.
 

William Lancee

Well-Known Member
Licensed User
Longtime User
Center alignment is the default on BBLabel. You don't need to set it.
If you have more than one line separated by a CRLF, both will be centered.
If you have a long line that is auto wrapped, the parts will all be centered.

B4X:
BBLabel1.text = $"Line 1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx${CRLF}Line 2 aaaa"$
 
Upvote 0

mscientist33

Active Member
Licensed User
The autowrapped part going to the second line is not being centered.

Here is what my line looks like

B4X:
BBLabel1.Text= $"[FontAwesome=0xF1EA size=30/][b][color=0xff006688]   "${rs.GetString("Title")}"[/color][/b] [TextSize=30] [/TextSize]"$
 
Last edited:
Upvote 0

mscientist33

Active Member
Licensed User
Ahhh, the FontAwesome is what is throwing it off. It appears as if its not centered but it really is. I need to put the FontAwesome icon in its own label I believe.

'Edit'
Wasn't the problem..... Still not centering the 2nd line of wrapped text.
 
Last edited:
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
Try adding a [Alignment=center] ....[/Alignment] tag. I realize when I was testing the wrapping that I had that.
 
Upvote 1
Top