ReactNative TextInput下文字无法居中

遇到react native的textinput,iOS下正常,像华为等android手机下文字无法居中,感觉文字的下划线像是居中了,文字偏上

问题原因

TextInput 有默认的padding

解决方法:

添加样式到textinput的样式中  比如随便设置个padding

ReactNative TextInput下文字无法居中_第1张图片

备注

TextInput中的文字居top、center、bottom可以根据textAlignVertical参数
android textAlignVertical enum('auto', 'top', 'bottom', 'center')

 

 

你可能感兴趣的:(ReactNative TextInput下文字无法居中)