Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2772] Android: View with auto width added to a ScrollView causes crash

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:00:03.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M04
ComponentsAndroid
Labelsandroid, defect, enterprise, regression, release-1.6.0, reported-1.6.0, rplist
ReporterBill Dawson
AssigneeBill Dawson
Created2011-04-15T03:29:08.000+0000
Updated2011-04-17T02:00:03.000+0000

Description

If you have a ScrollView then add a view to it -- and that view has no width property or width='auto' -- the application will crash when the child view is added to the ScrollView.

Failcase app.js:

Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({  
    title:'Test',
    backgroundColor:'#fff',
    exitOnClose: true
});

var sv = Ti.UI.createScrollView({
    contentWidth: 'auto',
    contentHeight: 'auto',
    height: 'auto',
    top: 0,
    backgroundColor: 'blue'
});

var v = Ti.UI.createView({
    backgroundColor: 'yellow',
    top: 0,
    height: 100
});

v.add(Ti.UI.createLabel({text: 'ScrollView child successfully added'}));

sv.add(v);
win.add(sv);
win.open();

Comments

  1. Bill Dawson 2011-04-15

    (from [f80836f22c8f978e2b890519202b938b592ecfc2]) [#2772 state:fixed-in-qa] Fix what looks like accidental code checking autoHeight when it should be checking autoWidth https://github.com/appcelerator/titanium_mobile/commit/f80836f22c8f978e2b890519202b938b592ecfc2"> https://github.com/appcelerator/titanium_mobile/commit/f80836f22c8f...

  2. Thomas Huelbert 2011-04-15

    iOS 4.2; G1 (1.6) Droid 1 (2.2.1). [INFO] Titanium SDK version: 1.6.0 (01/10/11 08:25 3452f06)

JSON Source