[TIMOB-6920] iOS: UI - imageView incorrect image height when hires property set to true
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-01-04T09:22:37.000+0000 |
Affected Version/s | Release 1.8.0.1 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Sindre Sorhus |
Assignee | Stephen Tramer |
Created | 2011-10-30T13:25:21.000+0000 |
Updated | 2017-03-21T21:08:11.000+0000 |
Description
Problem
When setting the height of an imageView toheight: 'auto'
and hires: true
, the imageView height expands the height of the window, instead of the height of the image.
It works correctly if hires: true
is removed.
See attached screenshots, with hires and without.
Test case
Ti.UI.backgroundColor = '#fff';
var win = Ti.UI.createWindow();
var imageView = Ti.UI.createImageView({
image: 'noop',
top: 0,
width: 280,
hires: true,
height: 'auto',
backgroundColor: 'green'
});
win.add( imageView );
win.open();
Attachments
File | Date | Size |
---|---|---|
Screen Shot 2011-10-30 at 22.17.24.png | 2011-10-30T13:25:21.000+0000 | 124558 |
Screen Shot 2011-10-30 at 22.18.06.png | 2011-10-30T13:25:21.000+0000 | 124360 |
Hi Sindre Thanks for raising this. Can you tell me, where did you find the imageView hires property documented? Was it just a single script in the KS? Would you test this code without modal enabled on the window, to determine whether or not it has any effect? I will mark this resolved for now. Please reopen it once it is complete, and I will move it to the main project. Thanks in advance
I thought I saw it in the docs, but can't find it in the new docs, but you can find it in hi_res_image_remote.js in KS. Don't know why I had the modal:true in there. Removing it doesn't change anything. Updated testcase.
Hi Sindre, The hires property is documented here. http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.ImageView.hires-property.html Note that it is only for use on remote images--images loaded from resources are already identified as hi-res or not hi-res by their filenames. In other words, the flag tells Titanium that the remote image is already at Retina resolution and should not be scaled automatically. From the looks of it, you're loading a local image, which may have undefined results. What effect were you trying to achieve? Thanks, -Arthur
@aevans, you're right, my mistake. This issue can be closed.
Should be closed as Invalid not Fixed...
Closing ticket as invalid.