Thanks for the suggestion, Panther! One thing that I didn't think would be a factor but I can't seem to get to work with your approach is to have the half image show a portion of the image that is offset from the top. That is, I don't want to show the top half of the image but a middle section (the 2nd quarter and 3rd quarter of the image):
The left image is how things start - only half of the full image is shown, the half being the middle section of the image. I then want to animate to the full image with the half originally show sliding into its proper position in the middle of the image.
The only way I worked out how to show the middle section on the top of the screen is to use drawRect but it pops instantly to its final position - rather than smoothly animating there - when I try to animate into a full screen display of the full image.
When I fiddle with the numbers in your approach, the final image is aways offset by the amount the image is originally offset by (although I want to set the offset to 0 when the full image is shown).
Are there ways to offset the image and then un-doing the offset with your appoach?
Thanks!
Quote:
Originally Posted by Panther
I think this achieves what you're describing.
Code:
//Setup
imageView.image = myImage;
imageView.frame = halfTheScreen;
imageView.clipsToBounds = YES;
imageView.contentMode = UIViewContentModeTop;
//To animate
[UIView animateWithDuration:duration animations:^{
imageView.frame = entireScreen;
}];
|