热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

iOSApp:可以制作键盘推荐吗?-iOSApp:Possibletomakekeyboardrecommendations?

InaniOSapplication,isitpossibletomakeownkeyboardsuggestionsiftheusertapsaspecificU

In an iOS application, is it possible to make own keyboard suggestions if the user taps a specific UITextField? The suggestion should only appear if the UITextField is empty.

在iOS应用程序中,如果用户点击特定的UITextField,是否可以制作自己的键盘建议?只有在UITextField为空时才会出现该建议。

By keyboard recommendations I mean the Predictive Keyboard:

通过键盘推荐我的意思是Predictive Keyboard:

enter image description here

Swift code is preferred.

Swift代码是首选。

Thanks!

谢谢!

1 个解决方案

#1


1  

I don't think you can provide suggestions to the actual keyboard so they get presented, but what you can do is write your own inputAccessoryView to be there instead, and handle the tapping/appending of text yourself, and possibly disable the completion from the keyboard. This is essentially what the messaging apps do to present a bar with buttons to add photos and attachments when writing.

我不认为你可以提供实际键盘的建议,所以他们会被呈现,但你可以做的是编写自己的inputAccessoryView代替,并自己处理文本的点击/追加,并可能禁用完成键盘。这基本上是消息传递应用程序用于显示带有按钮的栏,用于在写入时添加照片和附件。

enter image description here

Since you don't mention what you're trying to accomplish I don't know if this would make sense. Let me know if you want me to elaborate on how to do this in code.

既然你没有提到你想要完成什么,我不知道这是否有意义。如果您希望我详细说明如何在代码中执行此操作,请与我们联系。


推荐阅读
author-avatar
非洲小蘑菇bp
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有