可以为 UITextField 提供自定义单词建议源吗?
我想知道在 iOS 4.2 中的某个文本字段中编辑时是否可以有一个自定义建议词典
如下图所示,默认的建议词典是英语词典。我想知道的是,是否可以给它一个字符串数组,以便文本字段只给出这些字符串作为建议。
I am wondering if it is possible to have a custom dictionary of suggestions when editing in a certain text field in iOS 4.2
As you can see in the picture below, the default dictionary of suggestions is the english dictionary. What I would like to know is that if it is possible to give it, for example, an array of strings so that the text field would only give out those strings as suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这并不容易。
如果你想做到这一点,你似乎有两个选择,而且看起来都不那么容易。
1. 滚动您自己的建议覆盖代码并禁用苹果的东西。
2.(非常粗略)看看您是否可以利用 iOS 在输入文本时包含联系人姓名的事实。我相信它至少会这样做是为了将名称大写,但它也可能使用它来自动完成它们。
Not easily, unfortunately.
It seems like you have two options if you want to do this and neither look easy.
1. Roll your own suggestion overlay code and disable Apples stuff.
2. (Really sketchy) See if you can leverage the fact that iOS includes names of contacts when entering text. I believe it does this at least to capitalize names, but it may also use this to autocomplete them.