Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-28443

iOS: ScrollView setZoomScale()/setContentOffset() methods crash as of 10.0.0

    Details

    • Story Points:
      3

      Description

      See the following test case:

      var win = Ti.UI.createWindow({
          backgroundColor: '#fff'
      });
       
      var scrollView = Ti.UI.createScrollView({
          contentWidth: 'auto',
      	contentHeight: 'auto',
      	top: 0,
      	bottom: 0,
      	backgroundColor: 'black',
      	showVerticalScrollIndicator: false,
      	showHorizontalScrollIndicator: false,
      	maxZoomScale: 3,
      	minZoomScale: 1,
      	zoomScale: 1,
      	disableBounce: true
       
      });
      var content = Ti.UI.createImageView({ image: Ti.UI.createView({ width: 100, height: 100, backgroundColor: 'red', zoomScale: 1 }).toImage() });
       
      scrollView.addEventListener('doubletap', () => {
          console.warn('Zoom!')
      	scrollView.setZoomScale((scrollView.zoomScale === 1) ? 2 : 1, {
      		animated: true
      	});
      });
       
      scrollView.add(content);
      win.add(scrollView);
      win.open();
      

      Works fine on SDK 9.3.2, throws an error and does not work on SDK 10:

      [ERROR] /app.js:23
      [ERROR]   scrollView.setZoomScale(scrollView.zoomScale === 1 ? 2 : 1, {
      [ERROR]                           ^
      [ERROR] TypeError: scrollView.setZoomScale is not a function. (In 'scrollView.setZoomScale(scrollView.zoomScale === 1 ? 2 : 1, {
      [ERROR]     animated: true })', 'scrollView.setZoomScale' is undefined)
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              hknoechel Hans Knöchel
              Reviewer:
              Gary Mathews
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration