问题
I want to hide all the controls on the locked screen when an app is playing in the background. However, I want the audio related information to be displayed all the time.
I read about MPRemoteCommandCenter but we can't implement the below code because when you try to disable all then the screen starts showing 3 controls (toggle button, next track, previous track)
MPRemoteCommandCenter *rcc = [MPRemoteCommandCenter sharedCommandCenter];
[[rcc skipForwardCommand] setEnabled:NO];
[[rcc skipBackwardCommand] setEnabled:NO];
[[rcc nextTrackCommand] setEnabled:NO];
[[rcc previousTrackCommand] setEnabled:NO];
[[rcc skipForwardCommand] setEnabled:NO];
[[rcc skipBackwardCommand] setEnabled:NO];
rcc.playCommand.enabled = NO;
rcc.pauseCommand.enabled = NO;
Is there any other way to achieve what I am expecting? Currently play pause button is visible.
EDIT: My question is not a duplicate of How to disable all the MPRemoteCommand objects from MPRemoteCommandCenter because I want to hide. The answer given on the other question disables the controls.
来源:https://stackoverflow.com/questions/43995801/is-it-possible-to-hide-all-the-controls-when-screen-is-locked-objective-c