In myh App for the iPhone I have a UIScrollView which is twice the height of the actual screen. In the scrollview there is a button which when pressed alternates between the top portion of the scrollview and the bottom (with a nice sliding animation).
In the bottom portion of the ScrollView is a UIImageView which moves from the top of the screen to the bottom of the screen using the built-in animation blocks. Note I said screen which means the bottom visible portion of the UIScrollView.
My problem is that when the user presses the button to change view during the UIImageView’s animation the image does not stay on the bottom portion of the ScrollView, instead it keeps animating within the visible portion of the screen, which is not showing the top portion of the ScrollView.
Is there a way to specify the UIImageViews animation is within a ScrollView instead of having it be the visible portion of the screen?
I am using the
UIView animateWithDuration:<#(NSTimeInterval)#> animations:<#^(void)animations#>
code to perform the animation on the UIImageView.
Make the UIImageView a subview of your scroll view.
Set the
enabledproperty of your button toNOduring the animation.