1

Apple says, that all I have to do is to modify the bounds rectangle. Then the content inside the bounds rectangle would be stretched or jard into the frame rectangle.

But when I assign another CGRect with a smaller width to my bounds rectangle, nothing happens. The UIImageView keeps looking exactly the same. No compile errors. I guess that's not the way to go...

how do you do that?

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
Thanks
  • 40,109
  • 71
  • 208
  • 322
  • Are you calling setNeedsDisplay after changing the bounds rectangle? – pgb Apr 22 '09 at 14:36
  • Yes, but that doesn't change anything. Althoug the bounds rectangle is set to a smaller width, my displayed image is not stretched in any way. it remains in original size. Actually it should appear stretched, since the smaller portion defined by the smaller bounds rectengle has to fit into the bigger frame. Like Apple says. – Thanks Apr 22 '09 at 15:21

2 Answers2

0

changing the frame will stretch or compress an image. If it doesn't, I suspect you have a bug and we need to see your code to help further.

If you want to scale the image see this question.

Community
  • 1
  • 1
Rog
  • 17,070
  • 9
  • 50
  • 73
-1

If you're using a uiview, you need to send beginAnimations:context: to uiview (http://developer.apple.com/iPhone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/doc/uid/TP40006816-CH3-SW14)

EDIT: Try applying a CGAffineTransform to the view. I think the function is CGAffineTransformMakeScale(). You'll have to double check the docs.

Alex
  • 4,316
  • 2
  • 24
  • 28