Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19119] Windows: Components resize after their width or height has been calculated from left and right or top and bottom

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-07-03T04:31:36.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsWindows
Labelsn/a
ReporterGary Mathews
AssigneeChristopher Williams
Created2015-06-30T22:54:04.000+0000
Updated2015-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();

Comments

  1. Gary Mathews 2015-06-30

    PR: https://github.com/appcelerator/titanium_mobile_windows/pull/341
  2. Fokke Zandbergen 2015-07-01

    Workaround is setting width to Ti.UI.FILL.
  3. Christopher Williams 2015-07-02

    https://github.com/appcelerator/titanium_mobile_windows/pull/349
  4. Ingo Muschenetz 2015-07-03

    Resolving as merged to master. If you want this in 4.1.0, it needs a backport.
  5. Lokesh Choudhary 2015-07-07

    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

JSON Source