开发者

Can one provide a custom source of word suggestions for a UITextField?

开发者 https://www.devze.com 2023-02-22 16:50 出处:网络
开发者_运维问答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

开发者_运维问答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.

Can one provide a custom source of word suggestions for a UITextField?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消