2017-05-26 56 views
0

如何設置MPRemoteCommandCenter/MPNowPlayingInfoCenter添加查找按鈕?我想要實現的結果在屏幕截圖上。 Seek buttons should look like 我已經添加了此代碼:如何在iOS鎖屏上添加搜索按鈕?

[[MPRemoteCommandCenter sharedCommandCenter].seekForwardCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) { 
    [weakSelf rewindForward]; 

    return MPRemoteCommandHandlerStatusSuccess; 
}]; 
[MPRemoteCommandCenter sharedCommandCenter].seekForwardCommand.enabled = YES; 

[[MPRemoteCommandCenter sharedCommandCenter].seekBackwardCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) { 
    [weakSelf rewindBackward]; 

    return MPRemoteCommandHandlerStatusSuccess; 
}]; 
[MPRemoteCommandCenter sharedCommandCenter].seekBackwardCommand.enabled = YES; 

回答

相關問題