检测音量按钮按下并释放iOS [英] Detect volume button press and release iOS

查看:197
本文介绍了检测音量按钮按下并释放iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

程序访问iPhone音量按钮

可以检测iOS应用中的音量调高按钮按下/释放?

Is it possible to detect a volume up button press/release in an iOS app?

推荐答案

查看 http://fredandrandall.com/ blog / 2011/11/18 / take-control-of-the-volume-buttons-on-ios-like-camera /

以初始化音频会话,使其活动,然后监听改变。最后你启动一个回调。

Essentially you have to initialize an audio session, make it active, and then listen for changes. Finally you initiate a callback.

但是,要小心你的硬件命令的实现。无意中滥用可以让您从应用商店禁止。

However, be careful with your implementations of hardware commands. Unintentional misuse can get you banned from the app store.

这篇关于检测音量按钮按下并释放iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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