[TIMOB-8420] MobileWeb: Specifying a size in points (pt) causes layout errors.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-06-14T13:51:23.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | Release 2.1.0, Sprint 2012-12 MW |
Components | MobileWeb |
Labels | parity, qe-port |
Reporter | Arthur Evans |
Assignee | Bryan Hughes |
Created | 2012-03-29T13:12:52.000+0000 |
Updated | 2012-08-08T16:25:48.000+0000 |
Description
When adding a view with a size specified in points (pt), the layout does not work correctly.
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.
The same error occurs if the second view is sized in picas (pc) or ems (em), but not if it is sized in inches or units.
A *different* error occurs if it is sized in millimeters, but that is a subject for another bug.
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();
Attachments
File | Date | Size |
---|---|---|
composite_layout_android.png | 2012-03-29T13:12:52.000+0000 | 9657 |
composite_layout_mobileweb.png | 2012-03-29T13:12:53.000+0000 | 36590 |
Pull Request: https://github.com/appcelerator/titanium_mobile/pull/2380
Tested On: Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120807070117 Android 4.0.4 - default ,chrome 18.0 Iphone 4.3.5 - safari mobile Mountain lion(10.8) - chrome 21.0,safari 5.1.4,firefox 14.0.1