Android Question Left and right Alignment

Emme Developer

Well-Known Member
Licensed User
Longtime User
Hi to all! I have a label, and i want to set a part of text in left alignment, and 2nd part of text in right alignment. I tried to use CSBuilder, but i don't know why right alignment doesnt work. Any tips? Thanks

Code: Copy
    Dim cs As CSBuilder : cs.initialize
    cs.Typeface(Utils.SansLight).Alignment("ALIGN_NORMAL").Color(Utils.Black).Append(Utils.loc.Localize("utils2")).PopAll
    cs.Typeface(Utils.SansSemibold).Alignment("ALIGN_OPPOSITE").Color(Utils.Azzurro).Append("AkunaMatata..").PopAll
    lblRete.Text = cs
 
Hi to all! I have a label, and i want to set a part of text in left alignment, and 2nd part of text in right alignment. I tried to use CSBuilder, but i don't know why right alignment doesnt work. Any tips? Thanks

Code: Copy
    Dim cs As CSBuilder : cs.initialize
    cs.Typeface(Utils.SansLight).Alignment("ALIGN_NORMAL").Color(Utils.Black).Append(Utils.loc.Localize("utils2")).PopAll
    cs.Typeface(Utils.SansSemibold).Alignment("ALIGN_OPPOSITE").Color(Utils.Azzurro).Append("AkunaMatata..").PopAll
    lblRete.Text = cs
I'm not sure if you can have opposing alignments in the same string.

- Colin.
 
Upvote 0
From what I read in the CSBuilder tutorial, it seems that CSBuilder implements the Android CharSequence interface (https://developer.android.com/reference/java/lang/CharSequence.html). I guess whether or not it can do what you want depends on whether that particular functionality is implemented. If you haven't been able to get it to work, it would seem not - but Erel is probably the person who can answer that definitively.

- Colin.
 
Upvote 0
Back
Top