Is it possible to hide all the controls when scree

2019-03-04 13:33发布

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. enter image description here

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.

0条回答
登录 后发表回答