测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布上次发布 | 2015年11月 |
由 KITAGAWA Tatsuya 维护。
TKAutoCompleteTextField 是一个包含简单自动完成的UITextField。在输入一些字符时,它会显示 textField 下方的建议列表。
在 xib 或 storyboard 中设置 TKAutoCompleteTextField,并添加一个属性。然后,
// configure suggestions
self.autoCompleteTextField.suggestions = @[@"apple", @"orange", @"grape", @"lemon"];
// you can select match type; left-hand match or partical match.
self.autoCompleteTextField.enableStrictFirstMatch = YES; // default is NO
// you can select whether or not suggestion in empty input.
self.autoCompleteTextField.enablePreInputSearch = YES; // default is NO
就完成了。
TKAutoCompleteTextField:heightForSuggestionView:
: 指定最大高度。TKAutoCompleteTextField:numberOfVisibleRowInSuggestionView:
: 指定可见建议数量的限制。enableAutoComplete
: 显示建议视图。enableStrictFirstMatch
: 左手匹配或部分匹配。enablePreInputSearch
: 输入为空时显示建议视图。marginLefTextPlaceholder
marginTopTextPlaceholder