iPhone的音量更改事件已达到最大值 [英] iPhone volume changed event for volume already max
问题描述
我正在使用
AudioSessionAddPropertyListener(kAudioSessionProperty_CurrentHardwareOutputVolume,audioVolumeChangeListenerCallback,自我);
AudioSessionAddPropertyListener(kAudioSessionProperty_CurrentHardwareOutputVolume, audioVolumeChangeListenerCallback, self);
检测音量变化,以便我可以用音量摇杆拍摄照片,但是如果手机已经达到100%,则不会发生任何事件.当音量实际上没有变化时,是否有办法检测到音量摇杆被按下?
to detect volume changes so i can take a picture with the volume rockers but if the phone is already at 100% i don't get an event. Is there a way to detect volume rocker pressed when the volume doesn't actually change?
推荐答案
I found a good answer with full source code here:
当用户按下应用中的音量按钮时,您不需要要更改的系统音量.让他们服用会很烂图片,然后一路调高铃声音量.
When the user presses the volume buttons in your app, you don’t want the system volume to change. It would suck to have them taking pictures and turn up their ringtone volume all the way or something.
那我该怎么做呢?这很hacky,但是行得通.
So how do I pull that off? This is pretty hacky but it works.
这篇关于iPhone的音量更改事件已达到最大值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!