Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8422] iOS: Specifying a size in points is not supported

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2012-03-29T13:30:08.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sn/a
ComponentsiOS
Labelscore
ReporterArthur Evans
AssigneeNeeraj Gupta
Created2012-03-29T13:20:28.000+0000
Updated2017-03-09T23:25:42.000+0000

Description

When adding a view with a size specified in points (pt), the size specifier is ignored. Given the following code, the two labels l1 and l2 should be the same size and aligned vertically, as shown in the Android screenshot. Instead, the views are not aligned correctly and the sizes are wrong.
var win1 = Titanium.UI.createWindow({  
    title:'Composite Layout Test',
    backgroundColor:'#fff',
    layout: 'vertical'
});
var l1 = Titanium.UI.createLabel({
	top: 0,
	color:'#999',
	backgroundColor: 'blue',
	text:'1in',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'1in',
	height:'1in'
});
win1.add(l1);

var l2 = Titanium.UI.createLabel({
	top: 0,
	color:'#999',
	backgroundColor: 'red',
	text:'72pt',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'72pt',
	height:'72pt'
});
win1.add(l2);

var l3 = Titanium.UI.createLabel({
	top: 0,
	color:'#999',
	backgroundColor: 'green',
	text:'72 units',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:72,
	height:72
});
win1.add(l3);

win1.open();

Comments

  1. Arthur Evans 2012-03-29

    Rechecked spec. I thought "pt" was included, but it is not. It's only supported on Android.
  2. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source