Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7281] APIDoc: Document coding pattern for providing pinch/zoom while in a ScrollableView

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-02-09T23:32:12.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2012-02, Release 2.0.0, Release 1.8.1
ComponentsiOS
Labelsexpected, module_scrollview, qe-testadded, regression
ReporterMauro Parra-Miranda
AssigneeBlain Hamon
Created2012-01-18T14:36:46.000+0000
Updated2012-02-09T23:32:12.000+0000

Description

PROBLEM

Zoom used to work inside a ScrollableView, with 1.7.5. The same code doesn't work (doesn't zoom) in 1.8.

TESTCASE

Test this code in 1.7.5, do a zoom. Works fine. Do the same with 1.8, won't work.
var win = Ti.UI.createWindow({
    backgroundColor: 'black'
});
 var photosView = Ti.UI.createScrollableView({
    backgroundColor:'black',
    width : 320,
    height : 450,
    showPagingControl:true,
    pagingControlHeight:20,
    maxZoomScale : 2.0,
});
var imgArray = [];
var img1 = Ti.UI.createImageView({
    image:'http://media.koreus.com/200606/1image-illusion-optique14-mini.jpg'
});
imgArray.push(img1);
photosView.views = imgArray;
win.add(photosView);
win.open();

Community Discusion

http://developer.appcelerator.com/question/130153/image-zoom-not-working-after-update-to-sdk-18

Comments

  1. Blain Hamon 2012-01-20

    By the way, the new code is:
       var win = Ti.UI.createWindow({
           backgroundColor: 'black'
       });
        var photosView = Ti.UI.createScrollableView({
           backgroundColor:'black',
           width : 320,
           height : 450,
           showPagingControl:true,
           pagingControlHeight:20,
       });
       var imgArray = [];
       var img1 = Ti.UI.createImageView({
           image:'http://media.koreus.com/200606/1image-illusion-optique14-mini.jpg'
       });
       var imgWrapper = Ti.UI.createScrollView({
       	maxZoomScale:2.0,
       });
       imgWrapper.add(img1);
       
       imgArray.push(imgWrapper);
       photosView.views = imgArray;
       win.add(photosView);
       win.open();
       
  2. Blain Hamon 2012-01-20

    API update pull request #1225 sent. However, we should stress that this isn't a workaround. A workaround is when there's something broken. This is the new expected behavior, with a new code pattern to follow.
  3. Wilson Luu 2012-01-23

    Closing bug. Verified fix on: SDK build: 1.9.0.v20120121223134 Titanium Studio, build: 1.0.8.201201210622 Xcode: 4.2 OS: Mac OS X Lion (10.7.2) Device: iPhone 4S Verizon (5.0.1)
  4. Wilson Luu 2012-01-31

    updated labels

JSON Source