Android Question Possible to use different size in single label?

tufanv

Expert
Licensed User
Longtime User
Hello,

is it possible to size some part of the label with size 13 and other part with size 16 for example ?

Thanks
 

roumei

Active Member
Licensed User
You can use CSBuilder with the .Size property:
B4X:
    Dim cs As CSBuilder
    cs.Initialize.Alignment("ALIGN_LEFT")
    Dim tfSize As Float = Label1.TextSize
    cs.Typeface(Typeface.DEFAULT).Size(tfSize).Append("Label").Size(tfSize * 0.7).Append(" Text").PopAll
    Label1.Text = cs
Result:
LabelTwoSizes.jpg
 
Upvote 0
Top