如何在设置中检查iPhone键盘klick声音的开/关? [英] How to check iPhone keyboard klick sound turned on/off in settings?

查看:132
本文介绍了如何在设置中检查iPhone键盘klick声音的开/关?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用自定义键盘,如果在设置中启用了按键,则需要为按键播放按键音。点击声音不是问题,但如何检查是否启用了键盘声音?谢谢。

I'm working on custom keyboard and need to play tap sound for keys if it enabled in the Settings. Tap sound not a problem but how to check is keyboard click sound enabled ? Thanks.

推荐答案

如果您想制作完美的解决方案,您应该将以下的lcode添加到您的应用中。
否则在第一次读取后,设置被缓存,如果用户切换到设置,进行更改并切换回来,我们应该重新读取缓存的值。 :)

If you want to make the perfect solution, you should add the following lcode to your app. Otherwise after the first read, the setting is cached, and if the user switches to settings, makes change and switches back, we should re-read the cached value. :)

- (void)applicationWillEnterForeground:(UIApplication *)application {
CFPreferencesAppSynchronize(CFSTR("/var/mobile/Library/Preferences/com.apple.preferences.sounds"));

如果有人告诉我如何评论这个网站,我真的会更有帮助。

If someone tells me how to comment on this site I would really become more helpful.

这篇关于如何在设置中检查iPhone键盘klick声音的开/关?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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