是否知道是否可以将TextInput下划线的长度定义为给定长度,而与占位符长度和键入的输入长度无关?
答案 0 :(得分:0)
我在尝试更改其他内容时找到了答案...
如果为TextInput设置了宽度,则下划线的大小将设置为该宽度(以下指定的maxLength不会影响该宽度):
<TextInput
style={{ fontSize: 16, color: 'black',
width: 270, paddingLeft: 0 }}
placeholder='type text here...'
underlineColorAndroid='#888'
value={this.state.password}
onChangeText={(text) =>
this.onPasswordChange(text)}
editable = {true}
maxLength = {10}
/>