很想知道这个界面是如何实现的,另外,唱吧好象也有类似功能,在播放音乐时可以显示在待机界面。多谢。

解决方案 »

  1.   

    http://stackoverflow.com/questions/6600592/change-lock-screen-background-audio-controls-textiOS 5 now supports setting the track title as well as an album art image in both the lock screen and the remote playback controls (the controls you get when you double-click the home button and swipe right). Take a look at the MPNowPlayingInfoCenter class. Of course, to maximize compatibility, you'd want to test whether MPNowPlayingInfoCenter is available, by doing something like:if ([MPNowPlayingInfoCenter class])  {
       /* we're on iOS 5, so set up the now playing center */
       UIImage *albumArtImage = [UIImage imageNamed:@"HitchHikersGuide"];
       albumArt = [[MPMediaItemArtwork alloc] initWithImage:albumArtImage];    NSDictionary *currentlyPlayingTrackInfo = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"Life, the Universe and Everything", [NSNumber numberWithInt:42], albumArt, nil] forKeys:[NSArray arrayWithObjects:MPMediaItemPropertyTitle, MPMediaItemPropertyPlaybackDuration, MPMediaItemPropertyArtwork, nil]];
        [MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo = currentlyPlayingTrackInfo;
    }