Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

iOS RefreshControl issues

$
0
0

Seems like the two methods do not work at all. See below.

var win = Ti.UI.currentWindow;
var counter = 0;
function genData() {
    var data = [];
    var i = 1;
    for ( i = 1; i <= 3; i++) {
        data.push({
            properties : {
                title : 'ROW ' + (counter + i)
            }
        });
    }
    counter += 3;
    return data;
}
 
var section = Ti.UI.createListSection();
section.setItems(genData());
var control = Ti.UI.createRefreshControl({
    tintColor : 'red'
});
 
 
var listView = Ti.UI.createListView({
    sections : [section],
    refreshControl : control
});
 
 
control.beginRefreshing(); //It does not do anything when being called
control.endRefreshing(); //and this method either
 
control.addEventListener('refreshstart', function(e) {
    Ti.API.info('refreshstart');
    setTimeout(function() {
        Ti.API.debug('Timeout');
        section.appendItems(genData());
        control.endRefreshing();
    }, 2000);
});
 
win.add(listView);
Am I using them in wrong way? OR They are buggy??

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>