0

就像一个视频录制按钮。按下时开始,再次按下时停止。

一点指导将非常有帮助......在此先感谢!

4

1 回答 1

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];

        }


}
于 2012-07-30T14:55:55.850 回答