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

iOS: Feature: Expose setZoomScale:animated: method

    Details

      Description

      Feature

      Enable setZoomScale:animated: so scrollView can be animated.

      setZoomScale:animated:

      A floating-point value that specifies the current zoom scale.

      • (void)setZoomScale:(float)scale animated:(BOOL)animated
      Apple release docs

      http://developer.apple.com/library/ios/#documentation/uikit/reference/UIScrollView_Class/Reference/UIScrollView.html

      The case: zoomScale property cannot be animated on scrollview

      var win = Ti.UI.createWindow();
       
      var scroll = Ti.UI.createScrollView({
      	top: 0,
      	bottom: 0,
      	left: 0,
      	right: 0,
      	maxZoomScale: 5,
      	minZoomScale: 1
      });
      win.add(scroll);
       
      var img = Ti.UI.createImageView({
      	width: 320,
      	height: 320,
      	image: 'http://www.ryanboden.com/wp-content/uploads/2011/07/jay-z-and-kanye-west-watch-the-throne.jpg',
      	defaultImage: 'none',
      	hires: true,
      	
      });
      img.addEventListener('doubletap', function(e){
       
      	scroll.animate({
      		zoomScale: 1,
      		duration: 300
      	});
       
              //zoomScale only works on setZoomScale
              //which has the animated parameter to perform the animation        
              //scroll.setZoomScale( 1, { animated: true} );
       
      });
       
      scroll.add(img);
       
      win.open();
      

        Attachments

          Activity

            People

            • Assignee:
              blainhamon Blain Hamon
              Reporter:
              egomez Eduardo Gomez (Inactive)
            • Watchers:
              2 Start watching this issue

              Dates

              • Due:
                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