Reputation: 47
I use Path2.0. I have found that when I click the small picture in a message,there would be an animation to show the whole picture. How does it do that? I would really appreciate help here. Thanks!
Upvotes: 1
Views: 257
Reputation: 4396
I doubt they modify the original UIImageView; but a solution might be:
CGAffineTransformMakeScale()
function on a UIView's transform
property (inside a UIView animation block)Alternatively, you could instantiate the new subview with the full image, set it with the original UIImageView's frame, and then (using a UIView animation block), set it to the newer frame. To match their implementation exactly, I suggest a black subview (of the full UIImageView) with an alpha of 0.0 that you then animate at the same duration to an alpha of 1.0.
Upvotes: 0
Reputation: 5407
UiImageView is bascially a UIView, which you can apply animation on.
The use case you want to achieve combines:
a. a response to touch event, which you can use UITapGestureRecoginizer to attache a block of code
b. zoom the UIImageView into a proper size and position, you can use UIView's class method AnimiationWithDuration....
c. Ultimately, you want to change your UIImageView's frame property to a larger one. use CGRectMake to generate a new one. If you need to take the whole screen estate (like Path 2.0 does), you may need [UIApplication sharedApplication].window for this
Upvotes: 1