简体   繁体   English

第三方键盘中的resignFirstResponder()

[英]resignFirstResponder() in Third-Party Keyboards

I have a third party keyboard that currently contains a UISearchBar (that is first responder on start) and the user is able to search for content (ie gifs) to be able to copy, paste, send to friends, etc. 我有一个第三方键盘,该键盘当前包含一个UISearchBar (即启动时的第一响应者),并且用户能够搜索内容(即gif),以便能够复制,粘贴,发送给朋友等。

In theory, after entering text in the bar and pressing search, the user should be able to enter text in the application's actual UITextView (ie the message field in the messages app) but for some reason this doesn't work and although typing works, nothing actually appears. 从理论上讲,在栏中输入文本并按搜索后,用户应该能够在应用程序的实际UITextView输入文本(即,消息应用程序中的消息字段),但是由于某些原因,这不起作用,尽管键入有效,实际上什么也没出现。 I have tried searchBar.resignFirstResponder() , self.becomeFirstResponder() and many combinations of .endEditing(true) to no avail. 我尝试过searchBar.resignFirstResponder()self.becomeFirstResponder().endEditing(true)许多组合都无济于事。 I know it is possible to do this as apps like Giffy do it but I can't figure it out for the life of me. 我知道可以像Giffy这样的应用程序来执行此操作,但是我一生都无法解决。 Any help would be greatly appreciated. 任何帮助将不胜感激。

具有内置搜索栏的键盘扩展通常将它们的搜索栏实现为UILabel,添加自定义文本处理行为,该行为会根据用户输入修改标签的text属性。

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

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