Test Code
var win = Ti.UI.createWindow();
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.addEventListener('refreshstart', function(e) {
Ti.API.info('refreshstart');
setTimeout(function() {
Ti.API.debug('Timeout');
section.appendItems(genData());
control.endRefreshing();
}, 2000);
});
win.add(listView);
win.open();
control.beginRefreshing(); //It does not do anything when being called
Actual Result
Nothing happens
Expected Result
RefreshControl should show its loading state in other words show the spinning wheel at the top
Moving this ticket to engineering as I can reproduce the issue on iOS 7.0.3 simulator. No refresh control appears for the list view. Calling beginRefresh does not fire the event either.
Is there a timeframe for this issue fix since I urgently need this feature?
Any plan of fixing this issue?
Is there any timeframe for this ticket?
You can get around this for now by calling table.scrollToTop(-60) after beginRefreshing. It's actually spinning properly, just not moving the table down.
Thanks Billy for your workaround
This issue exist with 3.2.0 but can't reproduce with 3.4.0 iOS 7.1 iOS 7.0 TiSDK 3.4.0 Appcelerator Studio, build: 3.3.0.201407111535 Titanium Command-Line Interface, CLI version 3.3.0,
Alright, let's tackle this one! The problem is known on the native side, let me see if we can resolve by applying the contentOffset internally, guess that's the cleanest solution. Anyway, I am wondering why Apple does not do that themselves.
PR: https://github.com/appcelerator/titanium_mobile/pull/8115
Verified as fixed using the demo code provided. However, there seems to be a bug with iOS10 where the refresh indicator icon is not visible on the initial refresh, but the listView is updated correctly. Created a new ticket regarding the issue: TIMOB-23927 Tested On: iPhone 6 Plus 10.0.1 Device & Simulator iPhone 5S 9.3.5 Device iPhone 6 8.4 Simulator Mac OSX El Capitan 10.11.6 Ti SDK: 6.0.0.v20160917045955 Appc Studio: 4.8.0.201609101003 Appc NPM: 4.2.8-6 App CLI: 6.0.0-45 Xcode 8.0 Node v4.4.7 *Closing ticket.*