I have some code that moves a UITextView out from under the on-screen开发者_如何学C keyboard. The problem is, sometimes people will surely use a Bluetooth keyboard instead.
How can I detect that that is what's being used for input?
Also, BTW: I can detect when the on-screen keyboard goes away, but how to approach the same intention when it's a wireless keyboard?
Thanks.
You can detect when a bluetooth keyboard is connected by registering for UIKeyboardWillShowNotification the same way that you did for detecting when the keyboard hides. If a BT keyboard is connected, you will not receive a keyboard will show notification when the text field or text view that is requesting the keyboard becomes the first responder.
精彩评论