public static TruncateLabel ( UILabel label, float maxWidth ) : void | ||
label | UILabel | |
maxWidth | float | |
return | void |
public static void TruncateLabel(UILabel label, float maxWidth)
{
label.autoSize = true;
while (label.width > maxWidth)
{
label.text = label.text.Substring(0, label.text.Length - 4) + "...";
label.autoSize = true;
}
}