Ios 如何使我的应用程序的Control Center上的下一个和上一个曲目按钮消失?

Ios 如何使我的应用程序的Control Center上的下一个和上一个曲目按钮消失?,ios,iphone,audio-player,mpmusicplayercontroller,remote-control,Ios,Iphone,Audio Player,Mpmusicplayercontroller,Remote Control,我正在制作一款iPhone音乐应用程序,它可以处理音乐播放和暂停,并维护自己的播放列表。此应用程序不提供下一首/上一首歌曲功能,因此我不希望这些按钮显示在iOS的控制中心(向上滑动屏幕) 我尝试了以下代码使它们从那里消失: MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter]; // Do not allow next/prev song command on remote cont

我正在制作一款iPhone音乐应用程序,它可以处理音乐播放和暂停,并维护自己的播放列表。此应用程序不提供下一首/上一首歌曲功能,因此我不希望这些按钮显示在iOS的控制中心(向上滑动屏幕)

我尝试了以下代码使它们从那里消失:

MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter];

// Do not allow next/prev song command on remote control since this is not supported in app either
commandCenter.nextTrackCommand.enabled = NO;
commandCenter.previousTrackCommand.enabled = NO;
[commandCenter.nextTrackCommand addTarget:self action: @selector(emptyFunction)];
[commandCenter.previousTrackCommand addTarget:self action: @selector(emptyFunction)];
这不起作用:无论应用程序的音乐是否正在播放,这两个按钮仍会显示在向上滑动屏幕中,并且不会变灰,它们确实可以正常工作(虽然不正常,但这是无关的)

我该如何让它们消失