Fade out Playback Volume on MPMusicPlayerController on iOS 5

半腔热情 提交于 2020-01-01 03:25:39

问题


I was using this answer for how to fade out music player volume in my app, but in iOS 5, this leads to the on-screen HUD for volume appearing to the user, as if they had pressed the volume buttons on the side of their device. Does anyone know a workaround that doesn't display the HUD?


回答1:


I found a solution here: applicationMusicPlayer volume notification

It simply directs you to add an MPVolumeView to your view. For some reason, having that in the view hierarchy prevents the volume HUD from appearing. Works for me, hopefully for you too.



来源:https://stackoverflow.com/questions/7797726/fade-out-playback-volume-on-mpmusicplayercontroller-on-ios-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!