Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
问题描述
因此,在我的应用程序中,我想通过使用硬件按钮来更改应用程序内的音量级别以进行警报,但每当我使用按钮调高或调低音量时,它只会改变铃声"音量不影响我的应用内音量.
So in my app i would like to change the in app volume leves for an alarm by the use of the hardware buttons but whenever i use the buttons to turn up or down the volume it ONLY changes the "ringer" volume wich does NOT effect my in app volume.
在设置下 -> 听起来使用按钮更改"开关已打开,如果我将其关闭,一切正常,但大多数用户也希望将其打开.因此,当我在我的应用程序中时,我希望音量按钮来更改应用程序音量而不是铃声音量.
Under Settings -> Sounds the "change with buttons" switch is ON and everything works fine if i turn it off but most users will want to have it on as well. So when im in my app i want the volume buttons to change the app volume not the ringer volume.
希望有意义
谢谢
推荐答案
默认情况下,硬件按钮将更改警报音量,除非您在使用这些按钮时打开了音频会话.我建议打开一个 AVAudioSession 让他们更改它或在您的应用中的某个位置放置一个音量滑块让他们更改音量.
By default the hardware buttons will change the alarm volume unless you have an open audio session when they use the buttons. I would recommend opening an AVAudioSession to have them change it or placing a volume slider somewhere in your app to have them change the volume.
这是一个很难完美解决的问题,因为用户不会被告知哪里出了问题,而且很多时候也看不到铃声音量正在被更改.
This is a difficult problem to solve perfectly because users aren't told what is wrong and many times don't look to see that the ringer volume is what is being changed.
这篇关于硬件音量按钮更改应用程序音量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:硬件音量按钮更改应用程序音量


- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- android 4中的android RadioButton问题 2022-01-01