当用户双击主页按钮并向右滑动时,会显示一些音频控件。我如何使用它们?我已经搜索过,但没有找到任何对我有帮助的东西。
1 回答
1
试试这个
- (void) remoteControlReceivedWithEvent: (UIEvent *) receivedEvent {
switch (receivedEvent.subtype) {
case UIEventSubtypeRemoteControlTogglePlayPause:
[self playTapped];
break;
case UIEventSubtypeRemoteControlPreviousTrack:
[self previousTapped];
break;
case UIEventSubtypeRemoteControlNextTrack:
[self nextTapped];
break;
default:
break;
}
PlayTapped 是播放音乐的方法。nextTapped 是播放下一首歌曲的方法。previousTapped 用于播放上一首曲目。
祝一切顺利
于 2011-03-10T10:50:13.763 回答