react-native 不让输入框出现滑动的效果

最近做项目时遇到的输入框会上下滑动,原因不太懂,应该是跟高度有关,处理的方式就是设置lineHeight,设置为和高度一样,例如:

<TextInput
  style={{height: 20,lineHeight: 20, fontSize: 18}}
  underlineColorAndroid="transparent"
  maxLength={17}
  caretHidden={false}
  onChangeText={text => {}}
 />

猜你喜欢

转载自blog.csdn.net/lx_1024/article/details/85113197
今日推荐