[TIMOB-13243] iOS: ImageView - Image changes its position on the screen if orientation is changed
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-05-03T17:57:47.000+0000 |
Affected Version/s | Release 3.1.0 |
Fix Version/s | 2013 Sprint 08 API, 2013 Sprint 08, Release 3.1.1, Release 3.2.0 |
Components | iOS |
Labels | module_imageview, qe-3.1.0, qe-testadded |
Reporter | Anshu Mittal |
Assignee | Vishal Duggal |
Created | 2013-03-28T12:30:25.000+0000 |
Updated | 2013-07-24T11:16:29.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: 'photo.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 |
---|---|---|
photo.jpg | 2013-03-28T12:30:25.000+0000 | 467187 |
PR https://github.com/appcelerator/titanium_mobile/pull/4063 3_1_X PR https://github.com/appcelerator/titanium_mobile/pull/4080
Pull pending https://github.com/appcelerator/titanium_mobile/pull/4188
CR & FR
Backport to 3_1_X https://github.com/appcelerator/titanium_mobile/pull/4203
Issue still occurs with the following environment: SDK:3.1.1.v20130502180055 Appcelerator Studio: 3.1.1.201305020729 OS: OSX 10.7.5 Device: iPadMini(6.0) Xcode: 4.6
make sure you are using the actual image (1600 × 1200 resolution) and not the thumbnail image. There is another ticket(TIMOB-13643) linked to this one which deals with smaller images not being positioned correctly. Cannot reproduce the issue marking ticket back to resolved status. Please re-test. Checked on SDK : 3.1.1.v20130502180055 TiStudio : 3.1.1.201304161846 OS: OSX 10.8 Device: iPadMini(6.0) Xcode: 4.6
Tested with: SDK:3.1.1.v20130503173050 Appcelerator Studio: 3.1.1.201305031846 OS: OSX 10.7.5 Device: iPadmini(v 6.0)