Change Text Size Depending on Label lines

HimeAnator

Member
Licensed User
Longtime User
How would I change the text size in a label depending on how many lines the label is? I have a label that I need to display in one line. However if the user types in a lot of text then the label goes to two lines and the second line of text if cut off because I display an image right below the label. So I would like to shrink the text size so that it all fits on the first line. Is there a way to measure the number of lines the label has and if it is more than one then shrink the text size till it fits?
 

HimeAnator

Member
Licensed User
Longtime User
I do have one more question about SetLabelTextSize. Can it be used in a ListView? in case the text goes to two lines and gets cut off. I read the items into the ListView using a loop and I was able sorta get it working, it changed all the entries textsize to small even if the ListView label wasn't two lines. Any ideas?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
You cannot set different properties for the labels in a ListView.
You can differntiate single line and two lines but that's all.
The properties are valid for the labels of all entries.
If you want to differentiate them you should look at ScrollView, CustomListView and UltimateListView (chargable).

Best regards.
 
Upvote 0
Top