zl程序教程

您现在的位置是:首页 >  工具

当前栏目

React Native之TextInput组件实现联想输入

组件输入React 实现 native 联想
2023-09-27 14:22:50 时间

TextInput组件是最基本的组件,相关介绍请查看TextInput组件介绍

输入框组件属性

输入框组件的主要属性如下:

  • autoCapitalize :
    枚举类型,可选值有none,sentences,words,characters.当用户输入时,用于提示。
  • placeholder:占位符,在输入前显示的文本内容。
  • value : 文本输入框的默认值。
  • placeholdertTextColor : 占位符文本颜色。
  • password : 如果为ture , 则是密码输入框,文本显示为***。
  • multiline : 如果为true , 则是多行输入。
  • editable : 如果为false , 文本框不可输入。其默认值事true。
  • autoFocus : 如果为true, 将自动聚焦。
  • clearButtonMode : 枚举类型,可选值有never,while-enditing ,
    unless-editing,always.用于显示清除按钮。
  • maxLength : 能够输入的最长字符数。
  • enablesReturnKeyAutomatically :
    如果值为true,表示没有文本时键盘是不能有返回键的。其默认值为false。
  • returnKeyType :
    表示软键盘返回键显示的字符串。枚举类型,可选值有default,go,google,join,next,route