Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13734] iOS: ImageView - changes image aspect ratio when scaling

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.0.0, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
LabelsimageView
ReporterJon Alter
AssigneeUnknown
Created2013-05-01T19:49:30.000+0000
Updated2018-02-28T20:03:16.000+0000

Description

Our [documentation](http://docs.appcelerator.com/titanium/3.0/#!/guide/Images_and_ImageView_APIs-section-29004912_ImagesandImageViewAPIs-TheImageView) says that when you have height and width set on an imageView, it should scale image without changing its aspect ratio. This worked correctly in 2.1.4.GA, but is stretching the image as of 3.0.0.GA (see attached screenshot).

Steps to reproduce:

1. Run the code below with 3.0.0.GA or 3.0.1.GA. 2. Notice that the image is stretched 3. Run the code below with 2.1.4.GA 4. Notice that the image is not stretched as seen in the [documentation](http://docs.appcelerator.com/titanium/3.0/#!/guide/Images_and_ImageView_APIs-section-29004912_ImagesandImageViewAPIs-TheImageView).
var win = Ti.UI.createWindow({
	backgroundColor: 'white'
});
win.open();

var iv = Ti.UI.createImageView({
	image: "KS_nav_ui.png",
	height: 200,
	width: 50,
	backgroundColor: 'yellow'
});
win.add(iv);

Attachments

FileDateSize
Screen Shot 2013-05-01 at 12.50.09 PM.png2013-05-01T19:51:10.000+0000103334

Comments

  1. Vishal Duggal 2013-05-25

    TIMOB-3749 is the ticket that introduced this behavior change to make the imageView behave more like the web image view. Android has already made the change and MW has a parity ticket. Would mark this as wont fix or convert it to TIDOC for doc update.
  2. Russell McMahon 2013-06-17

    BlackBerry defaults to Fill so we do the stretch behavior. If we need to support other scaling we can open parity bug.

JSON Source