Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10597] iOS: Not scaling imageView when images property is assigned an array of images for animation

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-11-16T21:12:43.000+0000
Affected Version/sRelease 2.1.1
Fix Version/sRelease 3.1.0, 2012 Sprint 23 API, 2012 Sprint 23
ComponentsiOS
Labelsapi, qe-port
ReporterTrevor Borgmeier
AssigneeVishal Duggal
Created2012-08-14T22:25:00.000+0000
Updated2013-04-15T23:09:56.000+0000

Description

When an imageView is created with an "images" property, iOS no longer respects the width and height specified by the imageView. In my case the image is drawn much larger and off the screen. It may be rendering the image to it's actual size, rather than scaling it to the dimensions specified. When the imageView specified a single image via the "image" property (non plural) iOS scales the image properly. On android imageViews will render the correct dimensions when either the "image" or "images" property is called. (Android works properly)

Comments

  1. Nikhil Sharma 2012-08-23

    Hi Trevor, Can you please provide a reproducible sample test case?
  2. Trevor Borgmeier 2012-08-24

    Here is a sample in context to how I'm using it.
       
       var loaderDimensions = {width:492,height:35,scale:1}, // these are the dimensions of the original image
       	loaderMaxWidth = (2 * (Ti.Platform.displayCaps.platformWidth / 3)); // 2/3 of screen width
       
       loaderDimensions.scale = (loaderMaxWidth / loaderDimensions.width);
       
       loader = Ti.UI.createImageView({
       	top:0,
       	images:[
       		'/images/loaders/bar/1.png',
       		'/images/loaders/bar/2.png',
       		'/images/loaders/bar/3.png',
       		'/images/loaders/bar/4.png',
       		'/images/loaders/bar/5.png',
       		'/images/loaders/bar/6.png',
       		'/images/loaders/bar/7.png',
       		'/images/loaders/bar/8.png',
       		'/images/loaders/bar/9.png',
       		'/images/loaders/bar/10.png'
       	],
       	width:(loaderDimensions.width * loaderDimensions.scale),
       	height:(loaderDimensions.height * loaderDimensions.scale),
       	duration:50,
       	repeatCount:0
       });
       
       Ti.API.info('Loader Dimensions: ' + loader.width + ' x ' + loader.height);
       
       
    Ti.API.info returns "[INFO] Loader Dimensions: 213.33333333333334 x 15.176151761517616" On iOS, the image appears to draw at full scale width:492,height:35 rather than the dimensions specified. I know it worked properly in an earlier version and it does work on android. Let me know if you want me to send you the images I'm using.
  3. Vishal Duggal 2012-11-05

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/3379
  4. Satyam Sekhri 2013-01-22

    Verified on: Studio: 3.0.1.201212181159 SDK: 3.1.0.v20130114171802 iOS Device: iPhone Simulator (v6.0), iPhone 4S (v5.1) XCode: 4.5.2

JSON Source