0
基本上,每当我播放声音动画放缓或暂停,该怎么办?帮助!当播放声音动画冻结暂停
声音大小20kb mp3。
动画尺寸5kb png。
代码:
- (void) startAnimation {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.8];
CGPoint destination = CGPointMake(152,20);
pink.center = destination;
[UIView commitAnimations];
[soundPink play];
}
- (void) initSoundResources {
soundPink = [[APlayer alloc] initWithFile:@"pink" type:@"mp3"];
soundPink = 0.4;
}
首先感谢! 我是否需要更改initSoundResources方法中的某些内容? 我只是综合soundPink,我需要做更多的事吗? 如何将[UIViewsetAnimationDidStopSelector:@selector(playSound)]; 如果我需要定时器的声音? [NSTimer scheduledTimerWithTimeInterval:1.8 target:self selector:@selector(playSound)userInfo:nil repeats:false]; – nil 2009-12-10 14:19:37
我给你的代码应该工作,关于UIViewAnimation委托和didStopSelector。 关于你的initSoundResources,你不需要指定一个float到soundPink指针。编译器当然应该警告你,你没有看到它吗? – Jasarien 2009-12-10 17:55:55
我没有看到任何警告,你是什么意思分配一个浮动? – nil 2009-12-10 21:55:41