Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18544] iOS: ImageView not keeping aspect ratio after rotation

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.5.0
Fix Version/sn/a
Componentsn/a
LabelsAspectRatio, border, imageView, ios
ReporterAviram Zagorie
AssigneeUnknown
Created2015-02-09T09:18:12.000+0000
Updated2018-02-28T19:54:51.000+0000

Description

After rotation, imageView.getSize().width and imageView.getSize().height don't keep the image's aspect ratio. This can also be seen with the border around the image. To make things more confusing, the behavior is different per image (see red border in screen shots).

Attachments

FileDateSize
iOS Simulator Screen Shot Feb 9, 2015, 1.06.13 AM.png2015-02-09T09:18:12.000+0000255849
iOS Simulator Screen Shot Feb 9, 2015, 1.06.34 AM.png2015-02-09T09:18:12.000+0000371148
iOS Simulator Screen Shot Feb 9, 2015, 1.12.03 AM.png2015-02-09T09:18:12.000+00001077378
iOS Simulator Screen Shot Feb 9, 2015, 1.12.07 AM.png2015-02-09T09:18:12.000+0000677902

Comments

  1. Aviram Zagorie 2015-02-09

    index.xml ------------- index.js ---------- var imageView = Ti.UI.createImageView({ image:'image1.jpg', autorotate : true, borderColor: 'red', borderWidth: 2 }); $.container.add(imageView); imageView.addEventListener('postlayout', function() { Ti.API.info("imageView.postlayout"); }); $.index.addEventListener('postlayout', function() { Ti.API.info("index.postlayout"); }); $.index.open(); index.tss ----------- "#container": { width : Titanium.UI.FILL, height : Titanium.UI.FILL }

JSON Source