[TIMOB-19119] Windows: Components resize after their width or height has been calculated from left and right or top and bottom
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-07-03T04:31:36.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.1.0 |
Components | Windows |
Labels | n/a |
Reporter | Gary Mathews |
Assignee | Christopher Williams |
Created | 2015-06-30T22:54:04.000+0000 |
Updated | 2015-07-07T17:23:11.000+0000 |
Description
Components such as
TextField
get resized by Windows after loading. This resets the width
or height
properties if they have been calculated from the top, bottom
or left, right
properties.
var win = Ti.UI.createWindow({
backgroundColor: 'blue'
});
var viewA = Ti.UI.createTextField({
hintText: 'SOME TEXT',
top: '5dp',
left: '10dp',
// removing this line should allow the TextField to scale according to its contents
// retaining this line should scale the TextField to the same size as the red view below
right: '10dp',
height: '40dp'
});
var viewB = Ti.UI.createView({
backgroundColor: 'red',
top: '60dp',
left: '10dp',
right: '10dp',
height: '40dp'
});
win.add(viewA);
win.add(viewB);
win.open();
PR: https://github.com/appcelerator/titanium_mobile_windows/pull/341
Workaround is setting width to
Ti.UI.FILL
.https://github.com/appcelerator/titanium_mobile_windows/pull/349
Resolving as merged to master. If you want this in 4.1.0, it needs a backport.
Verified the fix. Closing. Environment: Appc Studio: 4.1.0.201507061719 Ti SDK: 4.1.0.v20150706111546 Ti CLI: 4.0.1 Alloy: 1.6.2 Windows: 8.1 Enterprise 64-bit APPC NPM: 4.1.0-1 APPC CLI: 4.1.0-5 Device: Nokia Lumia 928 - Windows Phone 8.1 Windows emulator : 8.1