Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2436] Android: scrollableView addView() causes exception

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-18T23:10:44.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0 M04
ComponentsAndroid
Labelsandroid, defect, regression, scrollable, view
ReporterPaul Dowsett
AssigneeDon Thorp
Created2011-04-15T03:19:49.000+0000
Updated2011-04-18T23:10:44.000+0000

Description

Environment: ubuntu 9.10, Titanium 1.5.X of 27th Nov, Google 2.2.

The following code demonstrates that addView() of scrollableView causes an exception. I have attached a clean project that includes the following code and the assets required. https://gist.github.com/718285">This is the exception output.

app.js:

var window = Ti.UI.createWindow({});

var parentView = Ti.UI.createView({
    backgroundColor:'blue'
});

window.add(parentView);

var cardSlider = Ti.UI.createScrollableView({
    backgroundColor: '#aaa'
});

for(var i=0, ilen=5; i<ilen; i++){
    Ti.API.info('Adding: /card/'+i+'.png');
    var screenView = Ti.UI.createView({});

    var image = Ti.UI.createImageView({
        // backgroudImage used to allow image to be scaled on android
        backgroundImage: '/card/'+i+'.png',
        width: 222,
        height: 168
    });
    screenView.add(image);
    cardSlider.addView(screenView);
}

parentView.add(cardSlider);

window.open();

Attachments

FileDateSize
resources.zip2011-04-15T03:19:50.000+0000116939

Comments

  1. Don Thorp 2011-04-15

    May be a regression from the removeView patch.

  2. Don Thorp 2011-04-15

    (from [0eed97c26b44ed50f0b3a9de6aff83bee1553abd]) [#2436 state:fixed-in-qa] Verified unit test and test in ticket didn't crash.

    Merge branch 'master' of https://github.com/dizzymonkey/titanium_mobile">https://github.com/dizzymonkey/titanium_mobile into dizzymonkey-master
    https://github.com/appcelerator/titanium_mobile/commit/0eed97c26b44ed50f0b3a9de6aff83bee1553abd"> https://github.com/appcelerator/titanium_mobile/commit/0eed97c26b44...

  3. Thomas Huelbert 2011-04-15

    sim 2.1, g2 2.2 Titanium SDK version: 1.5.0 (12/03/10 09:29 33c2058) using attached files no crash

JSON Source