I have an UIImageView
that's showing part of an image. Is there a way that I can animate the UIImageView
so that the image in it moves? So I wish to have my UIImageView
stay in it's position but the image in it move. Any way of doing it?
Asked
Active
Viewed 1,440 times
0

Tengyu Liu
- 1,223
- 2
- 15
- 36
-
UIImageView it's only container for UIImage – Anton Jul 18 '14 at 14:20
-
Read about core animation and core graphics. – Anton Jul 18 '14 at 14:22
-
@Anton If I knew which part I should read I wouldn't be hear asking. – Tengyu Liu Jul 18 '14 at 14:24
1 Answers
3
No, but the way you usually do this is by adding your UIImageView
to a UIScrollView
. Make the scroll view as large as you want the displayed image to be but make its contentSize
and the image view in it as large as they need to be.
Now you can animate the scroll position of the scroll view to smoothly animate the image position / crop.

Cornelius
- 4,214
- 3
- 36
- 55
-
Thanks man! I'm at work and can't test it, but it does look like a great solution :) – Tengyu Liu Jul 18 '14 at 14:26