Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26268] iOS: Make RefreshControl on ScrollView available on iOS < 10

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2018-08-24T17:21:38.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
ComponentsiOS
Labelsn/a
ReporterHans Knöchel
AssigneeHans Knöchel
Created2018-08-05T19:50:46.000+0000
Updated2018-08-24T17:21:47.000+0000

Description

Currently, we only support the refreshControl property on the Ti.UI.ScrollView for iOS 10+. We can support it for earlier versions as well:
var win = Ti.UI.createWindow({
    backgroundColor: '#fff'
});

var nav = Ti.UI.iOS.createNavigationWindow({
    window: win
});

var refreshControl =  Ti.UI.createRefreshControl();

refreshControl.addEventListener('refreshstart', function () {
    setTimeout(function () {
        refreshControl.endRefreshing();
    }, 2000);
});

var scrollView = Ti.UI.createScrollView({
    refreshControl: refreshControl,
    layout: 'vertical'
});

scrollView.add([
    Ti.UI.createView({ top: 30, width: 300, height: 100, backgroundColor: 'red'}),
    Ti.UI.createView({ top: 30, width: 300, height: 100, backgroundColor: 'red'}),
    Ti.UI.createView({ top: 30, width: 300, height: 100, backgroundColor: 'red'}),
    Ti.UI.createView({ top: 30, width: 300, height: 100, backgroundColor: 'red'}),
    Ti.UI.createView({ top: 30, width: 300, height: 100, backgroundColor: 'red'}),
    Ti.UI.createView({ top: 30, width: 300, height: 100, backgroundColor: 'red'}),
    Ti.UI.createView({ top: 30, width: 300, height: 100, backgroundColor: 'red'}),
    Ti.UI.createView({ top: 30, width: 300, height: 100, backgroundColor: 'red'}),
    Ti.UI.createView({ top: 30, width: 300, height: 100, backgroundColor: 'red'}),
    Ti.UI.createView({ height: 30 }),
])

win.add(scrollView);
nav.open();

Comments

  1. Hans Knöchel 2018-08-05

    PR: https://github.com/appcelerator/titanium_mobile/pull/10233
  2. Samir Mohammed 2018-08-13

    *Closing ticket.* Verified improvement in SDK version: 7.4.0.v20180810061237. Able to view the RefreshControl on a ScrollView. *FR Passed (Test Steps):*

    Created a titanium application with the test case above

    Ran the program

    Pulled down scroll view

    Able to see the RefreshControl

    Tested on iOS 9.3 and 11.2

    *Test Environment*
       APPC Studio: 5.0.0.201712081732
       APPC CLI: 7.0.4
       iphone 6 simulator (9.3)
       iphone 6 simulator (11.2)
       Operating System Name: Mac OS High Sierra
       Operating System Version: 10.13
       Node.js Version: 8.9.1
       Xcode 9.2
       

JSON Source