Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 181
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier

How to know the Label text has been truncated?

Is there any way to find out whether text of a Label has been truncated. For example when text of a single line Label is too long to fit in the Container it is automatically truncated at the end by gradually fading text out (see attached photo). This is a neat feature of Cascades but in my code I need to make some adjustments when this happens. How can I find this out?

 

example.png

 

On similar note, is it possible to set property of Label to not truncate the text?

 

---
If you find my post helpful please "like" it and "accept as a solution"
Highlighted
Developer
Posts: 181
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier

Re: How to know the Label text has been truncated?

Anyone?

---
If you find my post helpful please "like" it and "accept as a solution"
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: How to know the Label text has been truncated?

I could be wrong and can't check this right now, but I think multiline labels don't truncate text. Try switching the label to multiline by calling setMultiline(true). If that alone won't help, try adding a newline at the end.

Andrey Fidrya, @zmeyc on twitter