[TIMOB-7956] iOS: ImageView in ScrollView behaves differently in 1.8.2 and CI
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-03-14T14:39:10.000+0000 |
Affected Version/s | Release 1.8.2 |
Fix Version/s | n/a |
Components | iOS |
Labels | regression |
Reporter | Nikhil Sharma |
Assignee | Vishal Duggal |
Created | 2012-03-09T22:00:11.000+0000 |
Updated | 2017-03-09T23:07:42.000+0000 |
Description
ImageView in ScrollView behaves differently in 1.8.2 and 2.0.x CI build. In 2.0.x CI builds the image is initially zoomed in. Zoom in and zoom out also have different behaviors.
Repro Steps
1. Run the below code in both Ti SDK 1.8.2 and 2.0.x CI builds. 2. You can see the image is zoomed in 1.8.2 when the app starts and zoom in and zoom out have different behaviors.
var win1 = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var scrollView = Ti.UI.createScrollView({
maxZoomScale: 2.0,
minZoomScale: 0.3
});
var imageView = Ti.UI.createImageView({
backgroundColor: 'pink',
image: 'http://images.wikia.com/analytical/images/7/7e/Mountain.jpg'
});
scrollView.add(imageView);
win1.add(scrollView);
win1.open();
This is a behavior change due to composite layout definition. In 1.8.2 version undefined width and height of image view would default to FILL behavior as in width and height are constrained by parent size. In 2.0 undefined width and height of image view default to SIZE behavior as in SIZE is determined by image content. To see the same behavior in 2.0 as in 1.8.2 redefine imageView as
Closing ticket as invalid.