就像视频录制按钮一样。按下时启动,再次按下时停止。
一点指导会非常有帮助...... 提前谢谢!
答案 0 :(得分:0)
对于显示播放/停止的切换按钮,以下内容将起作用...
-(IBAction) togglePlay:(id)sender{
if (audioPlayer.playing) {
[audioPlayer stop];
[playButton setBackgroundImage:playSoundImage forState:UIControlStateNormal];
//set image play
}else{
[audioPlayer play];
[playButton setBackgroundImage:stopSoundImage forState:UIControlStateNormal];
}
}