开发者

Fade in Fade out button menu

I want to make a 'menu' with 4 options. This has to be 1 big frame where the buttons are being faded in and faded out over time, 1 by 1. So only 1 button is visible at any given time , not 4;

These buttons ofcourse are filled开发者_JAVA技巧 with Images

I don't know how to start , i've checked out some photoalbum code but it hasn't helped me.

The main problem is the user can click at any time in the animation of fade in and fade out, so how to decide when to go where ? Because when one imagebutton is faded out 50% another is 50% faded in.


try something like this....

[UIView beginAnimations:nil context:self.view];
[UIView setAnimationDuration:1];
[yourButton setImage:[UIImage imageNamed:your-image-name] forState:UIControlStateNormal];
[UIView commitAnimations];


if you dont want that the user can click during an animation then just disable (UIControl is inherited by UIButton) the buttons during animation.

You can set the UIView-Animation-Delegate to your class so your class gets notified when animation starts, ends, ...

[UIView setAnimationDelegate]

edit: if you want that the user can click on buttons during animation you have to know the wanted behaviour: which buttons should be clickable at which time?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜