NSTextField与建议下拉 [英] NSTextField with suggestions drop-down

查看:504
本文介绍了NSTextField与建议下拉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

而不是实现自己的,我正在寻找重用一个现有的自定义NSTextField,支持建议下拉 - 与浏览器中的一样,你输入你得到下面的建议列表。

$



解决方案

它们被称为完成。您仍然使用常规文本字段,但添加:

 控制:textView:completions:forPartialWordRange:indexOfSelectedItem 

最大的问题是你需要提供可以自动完成的单词列表。


Instead of implementing my own, I am looking into reusing an existing custom NSTextField that has support for suggestions drop-down - Same as the one in the browser as you type you get a list of suggestions underneath.

Do you know any good ones?

Thank you!

解决方案

They're called completions. You still use a regular text field but add this:

control:textView:completions:forPartialWordRange:indexOfSelectedItem

The biggest problem is you need to provide the list of words that can be autocompleted.

这篇关于NSTextField与建议下拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆