简体   繁体   English

如何在iPhone上禁用键盘点击声音?

[英]How to disable keyboard tap sound on iphone?

How do we disable the keyboard tap sound programatically? 我们如何以编程方式禁用键盘敲击声音? I am sure it's a setting in UItextfield. 我确定这是UItextfield中的设置。

The closest thing I was able to find is how to subclass particular views to disable sound: 我能够找到的最接近的东西是如何对特定视图进行子类化以禁用声音:

Can I disable UIPickerView scroll sound? 我可以禁用UIPickerView滚动声音吗?

I can't test this at work, but if it is possible, this may be related. 我无法在工作中对此进行测试,但是如果可能的话,这可能是相关的。 UIKeyboard is a class that you can't actually subclass though, nor even declare. UIKeyboard是一个您实际上不能子类化甚至声明的类。 You can find an actual reference to it though via the following method: 您可以通过以下方法找到对它的实际引用:

http://www.iphonedevsdk.com/forum/iphone-sdk-development/6573-howto-customize-uikeyboard.html http://www.iphonedevsdk.com/forum/iphone-sdk-development/6573-howto-customize-uikeyboard.html

Also, in the UIKeyboardImpl header file, I do see the setSoundsEnabled method: 另外,在UIKeyboardImpl头文件中,我确实看到了setSoundsEnabled方法:

http://ericasadun.com/iPhoneDocs/_u_i_keyboard_impl_8h-source.html http://ericasadun.com/iPhoneDocs/_u_i_keyboard_impl_8h-source.html

You cannot change this value. 您不能更改此值。 It's a user preference and only controllable through the Settings App. 这是用户偏好设置,只能通过“设置”应用进行控制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM