Search code examples
viewtitanium-mobiletitanium-alloy

Unable to add array of views to parent view on titanium android


I do not want to use a table view. The above code works fine with iOS but crashes on Android.

var rowViewList = [];
for (var i = 0; i < data.length; i++) {
    rowViewList.push(Alloy.createController("untilNextTime/minifigureTradingRow", {
        data : data[i]          
    }).getView());                      
}
$.parentFrameTrade.add(rowViewList); // This is the line where android crashes.parentFrameTrade is a normal view.

Solution

  • As documented the add() method only accepts a single view. You are right it works on iOS and we might make this official and have parity but not atm.