iPhone按下音量键时如何隐藏音量叠加 [英] iPhone how hide volume overlay when press volume key

查看:205
本文介绍了iPhone按下音量键时如何隐藏音量叠加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做了很多工作来解决它,比如添加MPVolumeView,有人说系统卷HUD
会隐藏,如果你在当前添加一个MPVolumeView实例,但是不起作用

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

但现在我迷失了如何隐藏音量HUD

but now i lost in how hide the volume HUD

我曾尝试过添加MPVolumeView实例的解决方案
但不会工作
请给我另一种解决方法

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.

推荐答案

你需要像这样放置音量叠加:

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

这篇关于iPhone按下音量键时如何隐藏音量叠加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆