Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10568] iOS : Label - Vertical alignment on label is not set properly

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2012-08-23T21:01:03.000+0000
Affected Version/sRelease 2.1.2
Fix Version/sn/a
ComponentsiOS
Labelsqe-ios082012
ReporterNeha Chhabra
AssigneeNeeraj Gupta
Created2012-08-23T03:04:57.000+0000
Updated2017-03-09T21:30:52.000+0000

Description

Vertical alignment on label is not set properly. This is not a Regression.It happens as far as 2.0.1. Steps To reproduce: 1. install and launch the app on to the device. 2. Click on Top or Bottom button Expected Result: After Step 2: the text on the label should be vertically aligned as per the button click. Actual Result: After Step 2: The text doesn't get vertically aligned app.js
	var win = Ti.UI.createWindow();
 
		var theFont = {fontSize: 11, font: 'Helevetica' };
		var container = Ti.UI.createView({
		    layout:'vertical'
		}) 
		var controls1 = Ti.UI.createView({
		    layout:'horizontal',
		    height:Ti.UI.SIZE,
		    top:10,
		    borderColor:'#ccc',
		    borderWidth:1
		}) 
		 
		var title1 = Ti.UI.createLabel({
		    font :theFont,
		color: 'white',
		    text:'V-ALIGN'
		})
		var c1b1 = Ti.UI.createButton({
		    left:10,
		    font :theFont,
		    title:'TOP'
		})
		var c1b2 = Ti.UI.createButton({
		    left:10,
		    font :theFont,
		    title:'BOTTOM'
		})
		var c1b3 = Ti.UI.createButton({
		    left:10,
		    font :theFont,
		    title:'CENTER'
		})
		controls1.add(title1);
		controls1.add(c1b1);
		controls1.add(c1b2);
		controls1.add(c1b3);
		container.add(controls1)
		 
		
		 
		var testLabel = Ti.UI.createLabel({
		    backgroundColor: 'white',
		height : 250,
		width : 250,
		    color: 'black',
		    //text:'I am the test label. Switch my properties around and see me change. Vertical Alignment should work well with change in size and text alignment.',
		    text:'A long label with\na few line breaks\nand unicode (UTF8)\nsymbols such as\na white chess piece \u2655\nand the euro symbol \u20ac\nlooks like this!\n',
		    borderColor:'red',
		    borderWidth:1,
		    top:10
		})
		container.add(testLabel);
		 
		win.add(container);
		 
		c1b1.addEventListener('click',function(e){testLabel.verticalAlign = Ti.UI.TEXT_VERTICAL_ALIGNMENT_TOP});
		c1b2.addEventListener('click',function(e){testLabel.verticalAlign = Ti.UI.TEXT_VERTICAL_ALIGNMENT_BOTTOM});
		c1b3.addEventListener('click',function(e){testLabel.verticalAlign = Ti.UI.TEXT_VERTICAL_ALIGNMENT_CENTER});
		
		         
       win.open();

    

Comments

  1. Lee Morris 2017-03-09

    Closing ticket as duplicate.

JSON Source