Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果蓝牙键盘连接到 iPad,我可以通过以下方式选择回车键:
-(BOOL)textFieldShouldReturn:(UITextField *)textField
但是如果我还需要检测tab键,我该怎么做?
仅供参考,在 ios 模拟器中使用硬件键盘本质上是一回事。
祝你好运; 请参阅下面的帖子以深入了解这个问题。:)
http://weaklyreferenced.wordpress.com/2012/11/13/responding-to-the-tab-and-shift-tab-keys-on-ios-5-ios-6-with-an-external-keyboard/
简短的回答是 iOS(至少从 iOS 6 开始)没有为tab密钥公开类似的方法,您必须发挥创造力才能检测到它。
tab