Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6920] iOS: UI - imageView incorrect image height when hires property set to true

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2012-01-04T09:22:37.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterSindre Sorhus
AssigneeStephen Tramer
Created2011-10-30T13:25:21.000+0000
Updated2017-03-21T21:08:11.000+0000

Description

Problem

When setting the height of an imageView to height: '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

FileDateSize
Screen Shot 2011-10-30 at 22.17.24.png2011-10-30T13:25:21.000+0000124558
Screen Shot 2011-10-30 at 22.18.06.png2011-10-30T13:25:21.000+0000124360

Comments

  1. Paul Dowsett 2011-12-26

    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
  2. Sindre Sorhus 2011-12-29

    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.
  3. Arthur Evans 2011-12-29

    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
  4. Sindre Sorhus 2012-01-03

    @aevans, you're right, my mistake. This issue can be closed.
  5. Sindre Sorhus 2012-01-04

    Should be closed as Invalid not Fixed...
  6. Lee Morris 2017-03-21

    Closing ticket as invalid.

JSON Source