[TIMOB-7281] APIDoc: Document coding pattern for providing pinch/zoom while in a ScrollableView
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-02-09T23:32:12.000+0000 |
| Affected Version/s | Release 1.8.0.1 |
| Fix Version/s | Sprint 2012-02, Release 2.0.0, Release 1.8.1 |
| Components | iOS |
| Labels | expected, module_scrollview, qe-testadded, regression |
| Reporter | Mauro Parra-Miranda |
| Assignee | Blain Hamon |
| Created | 2012-01-18T14:36:46.000+0000 |
| Updated | 2012-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();
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();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.
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)
updated labels