Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24545] Android: ellipsize not working with no width

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2017-03-29T17:29:20.000+0000
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, ellipsize, ipass1, label
ReporterKouroche Sedaghatian
AssigneeLokesh Choudhary
Created2017-03-29T17:28:33.000+0000
Updated2017-03-29T17:29:20.000+0000

Description

On Android, ellipsize will work for single line labels, only if the width property is defined and wordWrap is set to false. However, if the width of the label is defined in terms of left and right properties, ellipsize does not work. Ellipsize will work for the label below:
var win = Ti.UI.createWindow({
	backgroundColor : "#FFF"
});

var label = Ti.UI.createLabel({
	font : {
		fontSize : '32dp'
	},
	width : '250dp',
	height : '75dp',
	ellipsize : true,
	wordWrap : false,
	html : "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
});

win.add(label);
win.open();
Ellipsize will *not* work for the label below:
var win = Ti.UI.createWindow({
	backgroundColor : "#FFF"
});

var label = Ti.UI.createLabel({
	font : {
		fontSize : '32dp'
	},
	left : '10dp',
	right : '10dip',
	height : '75dp',
	ellipsize : true,
	wordWrap : false,
	html : "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
});

win.add(label);
win.open();

Comments

  1. Lokesh Choudhary 2017-03-29

    Created by mistake

JSON Source