Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10144] MobileWeb: Label - Request ellipsize on multiline label

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionNot Our Bug
Resolution Date2012-08-07T16:48:00.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sn/a
ComponentsMobileWeb
Labelsapi
ReporterAlexander Miller
AssigneeBryan Hughes
Created2012-07-25T15:35:47.000+0000
Updated2014-01-29T00:03:08.000+0000

Description

Request ellipsize at last line of Ti.UI.Label while still using wordWrap

Currently, in order to make a label use ellipsize we have to set wordWrap to false. Our project requires a multilined label that ends with an ellipsize. We could do this with multiple labels, but it is used often enough and should be less resource intensive to simply add this functionality to Label.

Example code

var win = Ti.UI.createWindow({
    backgroundColor:'#555'
});
var label = Ti.UI.createLabel({
	backgroundColor: '#FFF',
	borderWidth: 1,
	borderColor: '#000',
	width: 200,
	height: 44,
	fontSize: 14,
	ellipsize: true,
	wordWrap: true,
	verticalAlign: Ti.UI.TEXT_VERTICAL_ALIGNMENT_TOP,
	text: 'I used to be an adventurer like you until I took an arrow to the knee'
});
win.add(label);
win.open();
The desired effect is a label with 2 lines
I used to be an adventurer
like you until I took an...

Comments

  1. Bryan Hughes 2012-08-07

    Unfortunately we can't implement this feature because there simply is no way to do it. The "text-overflow" CSS property must be set to "nowrap" in order for ellipses to appear. For more information see http://www.quirksmode.org/css/textoverflow.html

JSON Source