作者sdanielle (DREAM)
看板MacDev
标题[问题] fadein和fadeout的连续动作
时间Mon Dec 26 13:51:21 2011
谢谢上次板友提供我宝贵的意见帮了我很大的忙
目前出现一个问题就是
我想让father这个物件在5点5秒时fadein
然後在7点5秒时fadeout
下面是我的程式码,结果他只能出现最後那个fadeout
自己试很多方法结果还是找不出为什麽
不晓得是哪里有错,
恳请各位高手帮忙解决~~谢谢
ViewController.h
- (void)viewDidLoad
{
[super viewDidLoad];
[NSTimer scheduledTimerWithTimeInterval:0.0 target:self
selector:@selector(fadein2:)
userInfo:nil repeats:NO];
[NSTimer scheduledTimerWithTimeInterval:0.0 target:self
selector:@selector(fadeout1:)
userInfo:nil repeats:NO];
}
-(void)fadein1:(NSTimer*)timer
{
[UIImageView beginAnimations:NULL context:nil];
[UIImageView setAnimationDuration:3];
[UIImageView setAnimationDelay:5.5] ;
[father setAlpha:1];
[UIImageView commitAnimations];
}
-(void)fadeout1:(NSTimer*)timer
{
[UIImageView beginAnimations:NULL context:nil];
[UIImageView setAnimationDuration:3];
[UIImageView setAnimationDelay:7.5] ;
[father setAlpha:0];
[UIImageView commitAnimations];
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.47.114.3