为什么播放音乐时控制按钮在锁定屏幕和命令中心禁用?我使用MPRemoteCommandCenter来控制通过远程访问。请帮助我,非常好。
顺便说一下
control button disable on command center
control button disable on lock screen
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.1) {
MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter];
commandCenter.playCommand.enabled = YES;
[commandCenter.playCommand addTarget:self action:@selector(playAction:)];
[commandCenter.pauseCommand addTarget:self action:@selector(pauseAction:)];
commandCenter.previousTrackCommand.enabled = YES;
[commandCenter.previousTrackCommand addTarget:self action:@selector(previousTrackAction:)];
commandCenter.nextTrackCommand.enabled = YES;
[commandCenter.nextTrackCommand addTarget:self action:@selector(nextTrackAction:)];
commandCenter.togglePlayPauseCommand.enabled = YES;
[commandCenter.togglePlayPauseCommand addTarget:self action:@selector(playOrPauseAction:)];
}