joh*_*ter 7 cocoa-touch objective-c uikit uiresponder ios
spotify如何处理自定义远程事件?目前在运行iOS 8.1.3的iPhone 6和Spotify版本2.4.0.1822上,当我打开spotify无线电时,我在锁定屏幕上获得以下控件.我已经尝试阅读所有与远程事件有关的文档,我无法找到任何允许来自锁定屏幕的自定义远程事件的资源.

小智 6
也许这是通过MPRemoteCommandCenter实现的.这是一个例子......
MPRemoteCommandCenter *remoteCommandCenter = [MPRemoteCommandCenter sharedCommandCenter];
[[remoteCommandCenter skipForwardCommand] addTarget:self action:@selector(skipForward)];
[[remoteCommandCenter togglePlayPauseCommand] addTarget:self action:@selector(togglePlayPause)];
[[remoteCommandCenter pauseCommand] addTarget:self action:@selector(pause)];
[[remoteCommandCenter likeCommand] addTarget:self action:@selector(like)];
Run Code Online (Sandbox Code Playgroud)
实现此代码,在您的应用上播放音乐,并锁定您的iPhone.您可能会看到自定义锁定屏幕.
注意 - 菜单可以自定义标签,但不能自定义图标图像和行数.
| 归档时间: |
|
| 查看次数: |
2632 次 |
| 最近记录: |