Iphone sequential animation with setAnimationDelay

谁说我不能喝 提交于 2019-12-06 12:08:30

When you animate this way, you're actually setting the relevant value immediately, and telling what's onscreen to animate to catch up to that new reality. So whatever value you set in the first animation block is being effectively ignored, because you've overwritten the fact that alpha == 1 by the fact that alpha == 0.

For doing more complex animations, it is worth building and adding the animations using CoreAnimation. It is a little more work, but you get lots more control.

In this case, you want to use an instance of CAKeyframeAnimation. You'll probably also want to use a CABasicAnimation to animate in your new quiz view. You can use a CAAnimationGroup to make sure that multiple animations that you add are synchronized.

I've hit similar issues, what seems to happen is the iPhone is optimizing the drawing which occurs in the same function.

What you can try doing is splitting the function up and performSelector. For example

[self performSelector:@selector(hideMessage) withObject:self afterDelay:1.0];

I've used this a few times with good results. If you want to see an excellent write up on doing great game style effects check out the Formic example code in iPhone cool projects. Wolfgang really pushes views for very pleasing game style effects.

Google books has it, but the book overall has some really great techniques.

Heres the google book link: http://books.google.com/books?id=_9qtPLmQxf8C&pg=PA6&lpg=PA6&dq=wolfgang+ante+formic&source=bl&ots=-vxvV3oLap&sig=G0BLW1RpItws-fwmXDI3mIjje4U&hl=en&ei=tVnzSt-3MImEMpL_8OgF&sa=X&oi=book_result&ct=result&resnum=1&ved=0CAoQ6AEwAA#v=onepage&q=wolfgang%20ante%20formic&f=false

Rich

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!