几个月前我为 iOS 9+ 设备开发了我的应用程序,当时MPNowPlayingInfoCenter按预期工作。但最近我也将我的 XCode 更新到最新的 9.3,并且由于一些 Pods 库正在更新,我不得不将其更改Deployment Target为 10.0.0。从那以后MPNowPlayingInfoCenter停止工作,再也不会出现在任何模拟器设备的锁定屏幕上。
MPNowPlayingInfoCenter.default().nowPlayingInfo = [
MPMediaItemPropertyTitle: self.playerItem.title.br2Sp.stripTags,
MPMediaItemPropertyArtist: self.playerItem.artist.br2Sp.stripTags,
MPNowPlayingInfoPropertyPlaybackRate: player.rate
]
Run Code Online (Sandbox Code Playgroud)
知道从那以后发生了什么变化吗?
PS停止工作是指我上面的代码不再Now Playing在锁定屏幕上显示信息。
找了好久,终于知道iOS Simulator v11.3 还不支持控制面板,显示的是一个没有任何控件的磨砂屏幕。我已经下载了 iOS Simulator v10.3.1 并且它现在出现了。
| 归档时间: |
|
| 查看次数: |
1039 次 |
| 最近记录: |