开发者

How can I detect when iOS 4 keyboard is on-screen versus Bluetooth?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜