Perhaps I wasn't clear.. When the text/string data is too large to fit inside a label, it is simply truncated. I am looking for a way for the truncation to end with an ellipsis (...) instead of just being chopped off, so the user of my app can tell explicitly there is more data than what is shown.
For example, if the text of a label is "now is the time for all good men" but the label is wide enough to show only "now is the time for a", it will appear as such
[now is the time for a]
but I'd like it to appear as
[now is the time fo...]
With a little research I found ellipsis in textview and jlabels, but no mention of label views. And B4A doesn't have textview views that I can use, so I'm stuck. I tried to setellipsize in a label using a reflector object, like you would in a textview, but it doesn't work as I wrote it
Here is my attempt:
Dim p As Panel
Dim l As Label
l.Initialize("trans")
l.Text = "now is the time for all good men to come to the aid of their country"
l.Gravity = Gravity.LEFT
l.TextSize = 20
l.Color = Colors.Transparent
l.TextColor = Colors.White
l.Tag = p
Dim obj As Reflector
obj.Target = l
'the definition is setEllipsize(TextUtils.TruncateAt)
'TextUtils.TruncateAt is an Enum, which End is listed first
obj.RunMethod2("setEllipsize", "0", "java.lang.int")
p.AddView(l, 3%x, 0, 65%x, 30dip)
The error I'm getting on the device is:
An error has occurred in sub:
main_addtrans(B4A line: 62)
obj.RunMethod2("setEllipsize",
"0", "java.lang.int")
java.lang.
NoSuchMethodException:
setEllipsize
Continue?
[Yes] [No]
Can anyone help with a work-around??
Help???