[TIMOB-26268] iOS: Make RefreshControl on ScrollView available on iOS < 10
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-08-24T17:21:38.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.5.0 |
Components | iOS |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Hans Knöchel |
Created | 2018-08-05T19:50:46.000+0000 |
Updated | 2018-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();
PR: https://github.com/appcelerator/titanium_mobile/pull/10233
*Closing ticket.* Verified improvement in SDK version:
7.4.0.v20180810061237
. Able to view theRefreshControl
on aScrollView
. *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*