Animation inside a UIScrollView

Hello,

I want to fade-out a view as it is scrolling inside a parent UIScrollview. When the fade-out animation begins, the scroll view stops scrolling. It jumps to the correct position when the fade is complete.

My fade-out is acheived with beginAnimations and commitAnimations, triggered upon a page-change I detect in scrollViewDidScroll.

Does anyone know how to make them both happen simultaneously?

Posted on Sep 28, 2009 3:40 PM

Reply
2 replies

Sep 28, 2009 11:25 PM in response to factoryGuy

factoryGuy wrote:
When the fade-out animation begins, the scroll view stops scrolling. It jumps to the correct position when the fade is complete.
Does anyone know how to make them both happen simultaneously?

Are you saying the scroll position currently jumps when the fade is complete, but instead (1) you want the view to scroll during the fade (which I would describe as simultaneous animation of two properties)?

Or are you asking how to (2) make the scroll position jump immediately after the fade is complete (which I would describe as sequential animation)?

For no. 1, all you need to do is place the change in the scroll view origin inside the same animation begin-commit block as the change in alpha.

For no. 2, you should add setAnimationDidStopSelector: to the block which animates alpha, then shift the scroll position in your animationDidStop:finished:context: method.

Hope that helps!
\- Ray

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Animation inside a UIScrollView

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.