Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10839] iOS: Labels are cut off at bottom in vertical layout

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2012-09-12T15:48:57.000+0000
Affected Version/sRelease 2.1.2
Fix Version/sn/a
ComponentsiOS
Labelscore, layout
ReporterGertjan Smits
AssigneeNeeraj Gupta
Created2012-09-04T07:25:05.000+0000
Updated2017-03-22T20:43:14.000+0000

Description

Problem description

Ti.UI.Label's are being cut of on the bottom in layout vertical when top is specified.

Test case

var w = Ti.UI.createWindow({
	backgroundColor:"white"
});

var container = Ti.UI.createView({
	width:500,
	height:250,
	borderColor:"blue",
	layout:"vertical"
});

var textLabel1 = Ti.UI.createLabel({
	width:Ti.UI.FILL,
	height:Ti.UI.SIZE,
	// bottom:10,
	text:"Vestibulum id ligula porta felis euismod semper.",
	font: {
		fontSize:24,
		fontWeight:"bold"
	}
});

var textLabel2 = Ti.UI.createLabel({
	// top:10,
	width:Ti.UI.FILL,
	height:Ti.UI.FILL,
	text:"Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Aenean lacinia bibendum nulla sed consectetur. Nullam quis risus eget urna mollis ornare vel eu leo. Donec sed odio dui. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Aenean lacinia bibendum nulla sed consectetur. Maecenas sed diam eget risus varius blandit sit amet non magna. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Maecenas sed diam eget risus varius blandit sit amet non magna. Sed posuere consectetur est at lobortis."
});

container.add(textLabel1);
container.add(textLabel2);
w.add(container);
w.open();
If you toggle the top:10 in textLabel2 on and off you see that the label is cut off and half a line is shown. If you give textLabel1 a bottom instead of textLabel2 a top it looks as expected. If you don't use vertical layout it works as expected.

Expected

Labels should truncate the labels text and add ...'s.

Comments

  1. Vishal Duggal 2012-09-12

    Different issue, same cause.
  2. Vishal Duggal 2012-09-12

    Duplicates TIMOB-10856
  3. Gertjan Smits 2012-12-22

    This is actually not a duplicate, and not fixed... (now also tested on SDK 3.0.0.GA, and in Alloy)
  4. Lee Morris 2017-03-22

    Closing ticket as duplicate of the ticket that is mentioned above and has since been closed.
  5. Gertjan Smits 2017-03-22

    Closed, not fixed...

JSON Source