iPhone how hide volume overlay when press volume key

拜拜、爱过 提交于 2020-01-22 16:28:13

问题


I have do lots to solve it,like add MPVolumeView,someone says that system volume HUD will hide if you add a instance of MPVolumeView in current,but that not work

i add obsever to observe the volume's change,and take picture

but now i lost in how hide the volume HUD

I had tried the solution that add MPVolumeView instance but won't WORK please give me another way to solve it

Any suggestions would be appreciated.


回答1:


You need to put volume overlay like this:

MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame: CGRectZero];
[self.view addSubview: volumeView];

Now the custom overlay won't be visible. But keep in mind that you are not able to get action on pressing volume buttons you can only be notified about its effect - changing a volume



来源:https://stackoverflow.com/questions/25521090/iphone-how-hide-volume-overlay-when-press-volume-key

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