[TIMOB-12636] MobileWeb: Incorrect Ti.UI.View width calculation
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2017-06-26T22:14:06.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | MobileWeb |
Labels | n/a |
Reporter | Yaroslav Pidstryhach |
Assignee | Unknown |
Created | 2012-11-26T13:47:11.000+0000 |
Updated | 2018-04-04T23:20:16.000+0000 |
Description
Consider the following Titanium code:
var view = Ti.UI.createView({
height : 200,
width : 200,
backgroundColor : 'yellow'
});
var viewChild = Ti.UI.createView({
backgroundColor : 'red',
center : {
x : 100
},
right : 50
});
view.add(viewChild);
var win = Ti.UI.createWindow();
win.add(view);
win.open();
view.addEventListener('postlayout', function() {
Ti.API.info(" POST_LAYOUT: the width of view should be 200: " + view.size.width);
Ti.API.info(" POST_LAYOUT: the width of viewChild should be 100: " + viewChild.size.width);
});
Ti.API.info(" Expected: the width of view should be 200: " + view.size.width);
Ti.API.info(" Expected: the width of viewChild should be 100: " + viewChild.size.width);
//Simulator iOS 6 output
//[INFO] : Expected: the width of view should be 200: 200
//[INFO] : Expected: the width of viewChild should be 100: 100
Expected
the width of viewChild should be 100. (The width should be calculated as: ((viewChild.center(100) - viewChild.right(50)) * 2), according to "http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.View-property-layout")Actual
The width of viewChild is 150tested on
FireFox 18.0.2
[INFO] POST_LAYOUT: the width of view should be 200: 200
index.html (line 2024)
info:
[INFO] POST_LAYOUT: the width of viewChild should be 100: 150
Resolving as "Won't Fix" as MobileWeb has been deprecated.
Closing as will not fix.