就像一个视频录制按钮。按下时开始,再次按下时停止。
一点指导将非常有帮助......在此先感谢!
对于显示播放/停止的切换按钮,如下所示将起作用...
-(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];
}
}