Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4487] iOS: Expose dragStart and dragEnd on Scroll View

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2011-08-12T13:00:43.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sSprint 2011-32, Release 1.8.0
ComponentsiOS
Labelsenterprise, module_scrollview, qe-port, qe-testadded
ReporterDawson Toth
AssigneeSabil Rahim
Created2011-06-23T09:56:08.000+0000
Updated2014-06-19T12:46:34.000+0000

Description

Feature

Expose two new events on a scroll view: "dragStart" and "dragEnd". These would occur with scrollViewWillBeginDragging and scrollViewDidEndDragging.

Sample Code

The following code would use these events.
var window = Ti.UI.createWindow({
    backgroundColor:'#fff'
});

var scrollView = Ti.UI.createScrollView({
    width: 320, height: 480,
    contentWidth: 2000
});
scrollView.addEventListener('dragStart', function(e) {
    Ti.API.info('drag start!');
    window.backgroundColor = '#aaa';
});
scrollView.addEventListener('dragEnd', function(e) {
    Ti.API.info('drag end! Will decelerate? ' + (e.decelerate ? 'Yes' : 'No'));
    window.backgroundColor = '#fff';
});
scrollView.add(Ti.UI.createLabel({
    text: 'Swipe Me',
    width: 2000, height: 50,
    textAlign: 'left'
}));
scrollView.add(Ti.UI.createLabel({
    text: '...and dragStart and dragEnd should fire!',
    width: 2000, height: 50,
    textAlign: 'right'
}));
window.add(scrollView);

window.open();

Associated Helpdesk Ticket

http://appc.me/c/APP-413136

Comments

  1. Dawson Toth 2011-06-23

    Pull Request

    https://github.com/appcelerator/titanium_mobile/pull/150
  2. Sabil Rahim 2011-08-09

    pull pending #351
  3. Rima Umbrasas 2012-08-13

    Verified fixed with : Mobile sdk-2.2.0.v20120810080115 Titanium Studio, build: 2.1.1.201207271312 Device: Ipad 5.1

JSON Source