[TIMOB-13643] iOS: ImageView - Image changes its position on the screen if zoomScale is greater than 1
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Cannot Reproduce |
| Resolution Date | 2017-06-26T22:43:43.000+0000 |
| Affected Version/s | Release 3.1.0 |
| Fix Version/s | n/a |
| Components | iOS |
| Labels | n/a |
| Reporter | Anshu Mittal |
| Assignee | Eric Merriman |
| Created | 2013-04-22T17:18:24.000+0000 |
| Updated | 2017-06-26T22:43:43.000+0000 |
Description
Image changes its position on the screen if orientation is changed. This is not regression since the issue occurs on 3.0.2 GA as well.
Steps to reproduce:
1. Create an app using the code below.
2. Launch the test app.Wait for the image to load.
3. Change Orientation to landscape and then again to portrait.
Actual:
The position of the image is changed on the screen.
Expected:
Position of the image should be same on the screen.
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var scrollView = Ti.UI.createScrollView({
maxZoomScale: 3,
contentWidth: 'auto',
contentHeight: 'auto'
});
var img = Ti.UI.createImageView({
image: 'flower.jpg',
width:Ti.UI.SIZE,
hight: Ti.UI.SIZE
});
function onImageLoad(e) {
var scaleWidth = win.size.width / img.size.width;
var scaleHeight = win.size.height / img.size.height;
// Set the initial ZoomScale
// And the MinZoomScale
scrollView.zoomScale = scrollView.minZoomScale = Math.min(scaleWidth, scaleHeight);
}
img.addEventListener('load', onImageLoad);
scrollView.add(img);
win.add(scrollView);
win.open();
Attachments
| File | Date | Size |
|---|---|---|
| flower.jpg | 2013-04-22T17:33:42.000+0000 | 17766 |
I am unable to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170623141152 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131