Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13643] iOS: ImageView - Image changes its position on the screen if zoomScale is greater than 1

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-06-26T22:43:43.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterAnshu Mittal
AssigneeEric Merriman
Created2013-04-22T17:18:24.000+0000
Updated2017-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

FileDateSize
flower.jpg2013-04-22T17:33:42.000+000017766

Comments

  1. Lee Morris 2017-06-26

    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

JSON Source