在键盘应用扩展程序中使用UITextField [英] Using UITextField inside a keyboard app extension
问题描述
我在自定义键盘上添加了textfield(keyboardTextField)。
我可以选择它并输入一些文字(使用我的自定义键盘)。但是我不可能选择主应用程序的输入视图。
这行代码
I added textfield (keyboardTextField) on top of my custom keyboard. I can select it and enter some text (using my custom keyboard). But it's impossible for me to select the input view of the main app back. This line of code
[keyboardTextField resignFirstResponder];
无效。如果有人有任何解决方法或任何想法,我需要你的帮助。
doesn't work correctly. If someone have any workaround or any ideas, I need your help.
推荐答案
我通过添加一个切换用户的按钮来解决这个问题。从UILabel(在我的情况下)输入到(正常 - iOS)UITextField在Messages fe
I fixed this by adding a button which switches the user input from the UILabel (in my case) to the (normal - iOS) UITextField in Messages f.e.
我检查BOOL以查看输入用户所选字符的位置。
I check on a BOOL to see where to enter the user selected character.
这篇关于在键盘应用扩展程序中使用UITextField的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!