Andrew
Andrew

Reputation: 708

iOS programming - how to zoom in and zoom out

How do you increase or decrease the size of a UIImageView in Obj-C? For example, I want a picture of duck to grow larger and larger. I can't find anything on this topic.

Upvotes: 2

Views: 978

Answers (2)

uadnal
uadnal

Reputation: 11435

If your talking about pinch-to-zoom, you must use a UIScrollView. Check out the documentation.

If you're looking to make the image animate from smaller to larger, use a UIView animation block on the UIImageView

Upvotes: 2

James
James

Reputation: 2282

If you are talking about pint-to-zoom, see Trevor's answer. But if you just want to programmatically increase the display size of the view, just modify the frame property of the UIImageView. If you increase the size of the view, the image will scale to fit.

Upvotes: 3

Related Questions