Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27068] Windows: Layout does not match with view size property

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Do
Resolution Date2020-06-30T14:40:03.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sn/a
ComponentsWindows
Labelsn/a
ReporterKota Iguchi
AssigneeChristopher Williams
Created2019-05-08T02:15:48.000+0000
Updated2020-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.

Comments

  1. Kota Iguchi 2019-05-29

    https://github.com/appcelerator/titanium_mobile_windows/pull/1394

JSON Source