[TIMOB-27068] Windows: Layout does not match with view size property
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Won't Do |
| Resolution Date | 2020-06-30T14:40:03.000+0000 |
| Affected Version/s | Release 8.0.0 |
| Fix Version/s | n/a |
| Components | Windows |
| Labels | n/a |
| Reporter | Kota Iguchi |
| Assignee | Christopher Williams |
| Created | 2019-05-08T02:15:48.000+0000 |
| Updated | 2020-06-30T14:40:03.000+0000 |
Description
Following code reports
height=200 (which is right) but the viewChild red view does not display 200 height actually. It looks to have 100 height.
var view = Ti.UI.createView({
height: 200,
width: 200,
backgroundColor: 'yellow'
}),
viewChild = Ti.UI.createView({
backgroundColor: 'red',
center: {
x: 100,
},
right: 50
});
var win = Ti.UI.createWindow();
viewChild.addEventListener('postlayout', function () {
console.log('height=' + viewChild.size.height);
});
view.add(viewChild);
win.add(view);
win.open();
Expected: viewChild should display 200 height.
Same thing happens on width property.
var view = Ti.UI.createView({
height: 200,
width: 200,
backgroundColor: 'yellow'
}),
viewChild = Ti.UI.createView({
backgroundColor: 'red',
center: {
y: 100,
},
bottom: 50
});
var win = Ti.UI.createWindow();
viewChild.addEventListener('postlayout', function () {
console.log('width=' + viewChild.size.width);
});
view.add(viewChild);
win.add(view);
win.open();
Expected: viewChild should display 200 width.
https://github.com/appcelerator/titanium_mobile_windows/pull/1394