如何区分iOS音量按钮,点击设置软件 [英] how to distinguish on iOS volume button clicked from setting it by a software

查看:134
本文介绍了如何区分iOS音量按钮,点击设置软件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在iOS应用程序中区分某人通过iPhone / iPad上的硬件按钮改变音量的情况,而不是由应用程序中的某些UI控件完成的情况?

Is there any way to distinguish in the iOS app a situation that someone have changed volume by hardware buttons on iPhone/iPad from the situation that it has been done by some UI control in the app?

我已经搜索过了,到目前为止,我想出了许多方法来通知卷已经更改但是没有办法知道它是否已经完成通过UI控件或硬件按钮。通知包括信息是否有变化的原因,但两种情况都相同。

I have searched for that and so far I came up with many ways to be notified that the volume has been changed but there is no way to find out whether it was done by the UI control or hardware buttons. Notifications include info abut a reason of change but it is the same for both situations.

推荐答案

经过长时间的搜索,我想出了这个:

After a long search I came up with this:

无法检测到按下的硬件按钮(到目前为止iOS 7)。您只能通知结果 - 更改了音量。这意味着唯一的解决方案是在某些UI组件触发卷更改时正确处理情况。

There is no way to detect hardware button been pressed (so far iOS 7). You can only be informed with the result - volume changed. It means that the only solution will be to properly handle situation when the volume change is triggered by some UI component.

这篇关于如何区分iOS音量按钮,点击设置软件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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