Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16218] iOS: Ti.UI.RefreshControl.beginRefreshing() does not work

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-07-11T17:44:02.000+0000
Affected Version/sRelease 3.2.0
Fix Version/sRelease 6.0.0
ComponentsiOS
Labelsapi, defect, ios, qe-6.0.0
ReporterDavid He
AssigneeHans Knöchel
Created2014-01-16T22:46:45.000+0000
Updated2016-09-19T17:38:39.000+0000

Description

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

Comments

  1. Ritu Agrawal 2014-01-17

    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.
  2. David He 2014-01-17

    Is there a timeframe for this issue fix since I urgently need this feature?
  3. David He 2014-02-05

    Any plan of fixing this issue?
  4. David He 2014-02-25

    Is there any timeframe for this ticket?
  5. billy 2014-03-11

    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.
  6. David He 2014-03-28

    Thanks Billy for your workaround
  7. Shameer Jan 2014-09-11

    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,
  8. Hans Knöchel 2016-06-16

    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.
  9. Hans Knöchel 2016-07-07

    PR: https://github.com/appcelerator/titanium_mobile/pull/8115
  10. Harry Bryant 2016-09-19

    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.*

JSON Source