[AC-1927] [ios] imageview: resizing with Ti.UI.SIZE when image size ratio != 1
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2012-08-15T12:41:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | autosize, imageview |
Reporter | Martin Guillon |
Assignee | Mauro Parra-Miranda |
Created | 2012-08-14T07:45:02.000+0000 |
Updated | 2016-03-08T07:40:51.000+0000 |
Description
If you fix only height(or width), and rely on Ti.UI.SIZE for the other. Then you will end up with an imageView of height you wanted but of the width of the source image.
var win = Titanium.UI.currentWindow;
var imageView = Titanium.UI.createImageView({
top:50,
left:10,
height:40,
backgroundColor:'red',
width:Ti.UI.SIZE
});
win.add(imageView);
var xhr = Titanium.Network.createHTTPClient();
xhr.onload = function()
{
imageView.image = this.responseData;
};
xhr.open('GET','http://www.maclife.com/files/u53/clouds.jpg');
xhr.send();
pull request coming
pull request https://github.com/appcelerator/titanium_mobile/pull/2739
Implementing requested behavior will break existing [layout specification| http://docs.appcelerator.com/titanium/2.1/index.html#!/guide/UI_Composite_Layout_Behavior_Spec]. According to "Precedence of layoutParams" section, width always has precedence other any other layout values.
You are right. Are you ok if i add a test
Cause in that case (which was my case), it should do that.