Quantcast
Viewing all articles
Browse latest Browse all 15

label with ellipse attribute truncates early

var win = Ti.UI.createWindow();
var label = Ti.UI.createLabel({
    text : 'Appcelerator gets your team up and running on Titanium with a full range of training and certification programs: in-classroom, on-demand, or on-site at your location.',
    width : 200,
    height : 200,
    top : 0,
    left : 0,
    ellipsize : true,
    wordWrap : true,
    backgroundColor : '#ddd'
});
win.add(label);
win.open();
The above code will only display 2 lines of text in the label and will end with a ... which is what I want.

But, if I remove the ellipsize : true attribute the label fills with the text but depending on the font size and/or label size can show partially drawn line at the bottom. I can't reliably determine the number of lines that will be displayed nor the font size as these are dynamic. Which is also what I want.

<sigh> Seems I can't have both multiple lines in the label and the ... end <\sigh>


Viewing all articles
Browse latest Browse all 15

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>