Apple doc은 "enabled 속성을 NO로 설정하여 해당 MPRemoteCommand 개체를 비활성화 할 수 있습니다"라고 말합니다.MPRemoteCommandCenter에서 모든 MPRemoteCommand 개체를 비활성화하는 방법
나는 Is there a public way to force MPNowPlayingInfoCenter to show podcast controls?라고 말했고 잠금 화면 제어에 대한 특정 명령을 사용 불가능하게하거나 사용 가능하게 만들 수있었습니다.
나는 라디오를 재생하고하고 작업 중 하나를 지원하지 않기 때문에 내가 잠금 화면 컨트롤에서 모든 컨트롤을 사용하지 않으려는하지만 -
나는 다음 시도 코드 "재생// 이전/일시 정지" :
MPRemoteCommandCenter *remoteCommandCenter = [MPRemoteCommandCenter sharedCommandCenter];
remoteCommandCenter.previousTrackCommand.enabled = NO;
[remoteCommandCenter.previousTrackCommand removeTarget:self];
remoteCommandCenter.nextTrackCommand.enabled = NO;
[remoteCommandCenter.nextTrackCommand removeTarget:self];
remoteCommandCenter.skipBackwardCommand.enabled = NO;
[remoteCommandCenter.skipBackwardCommand removeTarget:self];
remoteCommandCenter.skipForwardCommand.enabled = NO;
[remoteCommandCenter.skipForwardCommand removeTarget:self];
remoteCommandCenter.bookmarkCommand.enabled = NO;
[remoteCommandCenter.bookmarkCommand removeTarget:self];
remoteCommandCenter.playCommand.enabled = NO;
[remoteCommandCenter.playCommand removeTarget:self];
remoteCommandCenter.pauseCommand.enabled = NO;
[remoteCommandCenter.pauseCommand removeTarget:self];
그러나 작동하지 않았습니다. 모든 것을 비활성화하면 잠금 화면에서 일시 중지, 이전, 다음 버튼을 사용할 수 있습니다. 도움을 주시면 대단히 감사하겠습니다.
감사합니다. Sagar. 그 일. 목표가 어떻게 관련되어 있는지는 확실하지 않지만 나는 애플에게 같은 의견을 덧붙였다. –
안녕하세요,이 시도했지만 플레이어 화면에 나타나는 일부 흰색 오버레이 및 컨트롤 센터에서 새 단추를 수 없습니다. 문제가 무엇인지 알 수 있습니까? –