-1

I have abc.gif Image with single frame which i have created in MSPaint. I have also kept abc@2x.gif image with single frame.

But my gif image is not getting scaled properly in iPhone Retina device and simulator.

Is there any issue with this?? I have read on Apple that any image resource will be scaled. But gif image is not getting scaled.

DShah
  • 9,768
  • 11
  • 71
  • 127
  • Can you please clarify? (a) I assume you're creating this programmatically. Can you provide code? (b) What is the contentMode for the UIImageView?; (c) when you say not getting scaled properly on Retina device, are you saying that it does not appear to be grabbing the @2x image? So does it look like it does on non-retina display, but a little more pixelated? I don't quite get what you mean when you say "not getting scaled properly"? – Rob May 25 '12 at 10:18
  • Actually i got the pin point i was doing it programmatically. and still i didnt got solution. I am using UIImage to display image instead of UIImageView. In this case my GIF image is not getting scaled properly. – DShah May 25 '12 at 13:08
  • JFYI, I am showing GIF in UIView extended class. – DShah May 25 '12 at 13:21
  • If you're not using UIImageView, but rather some "extended UIView class", then there's no way any of us can help you unless you share the salient portions of that code with us. I hope there's a really compelling reason you're not using UIImageView. – Rob May 25 '12 at 13:27

2 Answers2

1

I have tried with single frame 1.gif image and also kept 1@2x.gif in resource folder. It display correct image in iPhone 4s and iPhone 3GS.

I think the problem is in the image. Try to create images with Photoshop and then test it.

Maulik
  • 19,348
  • 14
  • 82
  • 137
  • Hi Maulik, You are correct as far as when you use UIImageView, but i am using UIImage to display it. Also important thing is this is specific when i change image from PNG to GIF programmatically. At this time scaling is not proper. – DShah May 25 '12 at 13:11
  • JFYI, i am using UIView extended class for showing GIF image. – DShah May 25 '12 at 13:21
  • Hello Maulik, i have checked your answer with xcode and its not working at all. Just try this : Take same image 1.gif with yellow color in it. and 1@2x.gif with blue color. and then build this in Non-retina and Retina device this should work... But it does NOT.... But just change the extension to PNG ..... IT WORKS FINE.... – DShah May 25 '12 at 14:58
  • @DShah: True I am using image view and already both images are different 1.gif and 1@2x.gif.... !!! – Maulik May 26 '12 at 06:05
0

No, GIF image scaling is not supported on iPhone Device. Please try the above discussion code for answer.

DShah
  • 9,768
  • 11
  • 71
  • 127