2015-07-21 57 views

回答

2

你無法隱藏它們。但在iOS 7.1開始你可以禁用它們:

// Disable previous track button 
[MPRemoteCommandCenter sharedCommandCenter].previousTrackCommand.enabled = NO; 
// Disable next track button 
[MPRemoteCommandCenter sharedCommandCenter].nextTrackCommand.enabled = NO; 

對於播放時長,只是不要在您[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:]

設置MPMediaItemPropertyPlaybackDuration東西最重要的是,你可以自定義顯示的信息(甚至是藝術作品):

NSMutableDictionary *songInfo = [[NSMutableDictionary alloc] init]; 
[songInfo setObject:someTitle forKey:MPMediaItemPropertyTitle]; 
[songInfo setObject:someArtist forKey:MPMediaItemPropertyArtist]; 
[songInfo setObject:someAlbum forKey:MPMediaItemPropertyAlbumTitle]; 

MPMediaItemArtwork *albumArt; 
if (song.artwork){ 
    albumArt = [[MPMediaItemArtwork alloc] initWithImage: someArtwork]; 
} 
else { 
    albumArt = [[MPMediaItemArtwork alloc] init]; // make sure to remove the artwork if none is found for the current track 
} 
[songInfo setObject:albumArt forKey:MPMediaItemPropertyArtwork]; 
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songInfo]; 
相關問題