Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

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

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-27T08:42:54.000+0000
Affected Version/sRelease 2.1.2
Fix Version/sRelease 3.0.2
ComponentsiOS
Labelsapi, qe-ios082012
ReporterNeha Chhabra
Assigneejithinpv
Created2012-08-23T03:05:08.000+0000
Updated2014-07-17T10:10:40.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. jithinpv 2013-03-27

    Issue does not reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
  2. jithinpv 2013-06-21

    Issue does not reproduces Tested with iOS SDK: 5.1 iOS iPad Simulator: 5.1 Mac OS X Version 10.7.5 Titanium SDK version 3.1.1.v20130606121419 Titanium Studio, build: 3.0.1.201212181159

JSON Source