Titanium JIRA Archive
Appcelerator Community (AC)

[AC-458] ImageView does not scale images correct

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionInvalid
Resolution Date2015-11-05T08:06:38.000+0000
Affected Version/sAppcelerator Studio 4.3.1
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsImageView, Scaling, ios
ReporterThomas Neerup
AssigneeMotiur Rahman
Created2015-10-12T13:12:39.000+0000
Updated2015-11-05T08:48:34.000+0000

Description

According to the docs, setting width or height on an ImageView should cause it to scale the image. But when setting the height to Ti.UI.FILL the image does not scale setting width to Ti.UI.FILL works fine. The problem exists when upscaling and downscaling. I Attached an example To run sample: 1. Create new Alloy project 2. Copy attached index.xml to controllers 3. Copy attached image to /assets/images 4 Run project to iPad emulator When the app launches notice: 1 Row upscales just fine (height=Ti.UI.FILL) 2 Row does not upscale at all (width=Ti.UI.FILL).. 3 Row downscales just fine (height=Ti.UI.FILL) 4.Row downscales but ImageView also fills the width, so aligning to left or right is not possible(height=Ti.UI.FILL) Expected results 1 Row images should upscale just like it does now (height=Ti.UI.FILL) 2 Row images should upscale like Row 1 (width=Ti.UI.FILL).. 3 Row images should downscale just like it does now (height=Ti.UI.FILL) 4.Row images should downscale like Row 3 (height=Ti.UI.FILL)

Attachments

FileDateSize
aspect4.png2015-10-12T13:00:24.000+000013440
index.xml2015-10-12T13:00:05.000+00002765
PastedGraphic-1.png2015-10-12T13:01:50.000+0000145665

Comments

  1. Mostafizur Rahman 2015-10-29

    Hello [~thomas.neerup@eg.dk], Specifying either a width or height property for the Image view will scale its image(s) with the aspect ratio maintained, up to a maximum size that does not exceed its parent view. Please refer to this [link here](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ImageView). It seems to me this is not an issue. *Testing Environment:* Appcelerator Command-Line Interface, version 5.0.4 Appcelerator Studio, build: 4.3.3.201510212245 Ti sdk: 5.0.2 iOS Simulator: iPad Alloy version: 1.7.18 Thanks
  2. Thomas Neerup 2015-11-05

    Hi Mostafizur... But as you can see on the posted image this is not the case... I'm a bit confused here. Is my description of the problem not good enough? I set the height to Ti.UI.FILL on the first row of imageviews and it works fine.. I set the width to Ti.UI.FILL on the second row of imageviews and it does not upscalescale correct. Please let me know if I need to explain mere... Thanks

JSON Source