[TIMOB-19598] Bug with Ti.UI.SIZE for view height on android
GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-08-23T00:06:03.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.2.0 |
Components | Android |
Labels | TCSupportTriage, android |
Reporter | Andrey Pervushin |
Assignee | Joshua Quick |
Created | 2014-12-24T14:47:35.000+0000 |
Updated | 2017-08-23T00:06:46.000+0000 |
Description
height for view on android calculating wrong and different then on iOS
this happens if layout set to 'horizontal' and child views have width set to Ti.UI.FILL
~~~
var win = Ti.UI.createWindow({
backgroundColor : '#fff'
});
var font = {
fontSize : '14dp'
};
var View = Ti.UI.createView({
height : Ti.UI.SIZE,
borderColor : '#666',
borderWidth : '1dp',
left : '10dp',
right : '10dp',
top : '50dp',
layout : 'horizontal',
backgroundColor : '#dfd'
});
var toLabel = Ti.UI.createLabel({
left : '5dp',
top : '5dp',
text : 'To:',
width : Ti.UI.SIZE,
font : font,
backgroundColor : '#dfa'
});
var toCardLabel = Ti.UI.createLabel({
top : '5dp',
right : '5dp',
text : '123456789\n($456)',
width : Ti.UI.FILL,
textAlign : 'right',
font : font,
color : '#666',
backgroundColor : '#bfd'
});
var fromLabel = Ti.UI.createLabel({
left : '5dp',
top : '5dp',
text : 'From:',
width : Ti.UI.SIZE,
font : font,
backgroundColor : '#bdd'
});
var fromCardLabel = Ti.UI.createLabel({
top : '5dp',
right : '5dp',
text : '123456789\n($456)',
width : Ti.UI.FILL,
textAlign : 'right',
font : font,
color : '#666',
backgroundColor : '#ee9'
});
var amountLabel = Ti.UI.createLabel({
left : '5dp',
top : '5dp',
bottom : '5dp',
height : Ti.UI.SIZE,
text : 'Amount to transfer:',
width : Ti.UI.SIZE,
font : font,
backgroundColor : '#ee6'
});
var amountField = Ti.UI.createLabel({
top : '5dp',
right : '5dp',
text : '$1245',
width : Ti.UI.FILL,
textAlign : 'right',
color : '#393',
font : font,
backgroundColor : '#cdb'
});
win.add(View);
View.add(toLabel);
View.add(toCardLabel);
View.add(fromLabel);
View.add(fromCardLabel);
View.add(amountLabel);
View.add(amountField);
win.open();
~~~
Attachments
Passed FR. PR merged. Changes are seen in SDK versions: 6.2.0.v20170822113609 7.0.0.v20170822142802