I was getting frustrated with duplicating my xml code just so that i could wrap it in <SwipeRefresh> for Android, also using 'Require' to pull in the code was proving messy. The solution was simpler than I thought... simply 'remove' the ListView from the display before then adding it to the swipeRefresh module.
if (OS_ANDROID){
var swipeRefreshModule = require('com.rkam.swiperefreshlayout');
$.main.remove($.scrollContent); // application crashes without this line
var swipeRefresh = swipeRefreshModule.createSwipeRefresh({
view: $.scrollContent,
height: Ti.UI.FILL,
width: Ti.UI.FILL
});
$.main.add(swipeRefresh);
}
Thanks. Although I would prefer to stick to standard practice since ListView can be anywhere in view hierarchy and therefore re-adding does not necessary produce same result.
Hi, this is more of a new solution than an issue!
I was getting frustrated with duplicating my xml code just so that i could wrap it in
<SwipeRefresh>
for Android, also using 'Require' to pull in the code was proving messy. The solution was simpler than I thought... simply 'remove' the ListView from the display before then adding it to the swipeRefresh module.Consider the following:
In your controller you can do this:
Hope this helps some people!