2015-07-21 99 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]; 
相关问题