TKAutoCompleteTextField 0.3.0

TKAutoCompleteTextField 0.3.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布上次发布2015年11月

KITAGAWA Tatsuya 维护。




  • 作者:
  • yatatsu

TKAutoCompleteTextField 是一个包含简单自动完成的UITextField。在输入一些字符时,它会显示 textField 下方的建议列表。

alt tag

使用方法

在 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

就完成了。

其他

委托(Delegates)

  • TKAutoCompleteTextField:heightForSuggestionView: : 指定最大高度。
  • TKAutoCompleteTextField:numberOfVisibleRowInSuggestionView: : 指定可见建议数量的限制。
    • 默认值为 3。

属性(Properties)

  • enableAutoComplete : 显示建议视图。
  • enableStrictFirstMatch : 左手匹配或部分匹配。
  • enablePreInputSearch : 输入为空时显示建议视图。
  • marginLefTextPlaceholder
  • marginTopTextPlaceholder

作者

yatatsu, [email protected]