[問題] fadein和fadeout的連續動作
謝謝上次板友提供我寶貴的意見幫了我很大的忙
目前出現一個問題就是
我想讓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
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章