[TIMOB-2772] Android: View with auto width added to a ScrollView causes crash
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T02:00:03.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M04 |
Components | Android |
Labels | android, defect, enterprise, regression, release-1.6.0, reported-1.6.0, rplist |
Reporter | Bill Dawson |
Assignee | Bill Dawson |
Created | 2011-04-15T03:29:08.000+0000 |
Updated | 2011-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();
(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...
iOS 4.2; G1 (1.6) Droid 1 (2.2.1). [INFO] Titanium SDK version: 1.6.0 (01/10/11 08:25 3452f06)