View Single Post
03/18/21, 08:16 PM   #1
Armodeniz
 
Armodeniz's Avatar
AddOn Author - Click to view addons
Join Date: May 2020
Posts: 3
Question How can i set a label text's max width?

I set a Label control like this:
xml Code:
  1. <Label name="$(parent)Name" font="ZoFontGameSmall" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_DISABLED" width="110" height="20" wrapMode="TEXT_WRAP_MODE_TRUNCATE">
  2.     <Anchor relativeTo="$(parent)Star" point="LEFT" relativePoint="RIGHT" offsetX="2" offsetY="0"/>
  3. </Label>

It is in a virtual control and will be created many times in lua file.

But it seems that the wrapMode="TEXT_WRAP_MODE_TRUNCATE" doesnt work, the long text will expand without being truncated. How can i set the max width of a text?
  Reply With Quote