阻止TextInput字段中的文本滚动和截断

问题描述 投票:2回答:2

我在TextInput应用程序中有React-Native字段,我无法在字段中获取文本以不滚动和截断文本的底部而不将行高设置为非常大的值。

这是一个正在发生的事情的图像:

样式道具如下:

input: {
  height: 28, 
  paddingBottom: 0, 
  fontSize: 18,  
  color: '#000', 
  borderBottomWidth: 1.5,    
},

有没有办法可以强制文本不在TextInput内移动

react-native react-native-android textinput
2个回答
1
投票

android中的TextInput似乎有一个默认的paddingBottom设置,而iOS没有,因为android有下划线标签,但ios没有。不同的默认填充每个平台。

这就是paddingBottom或paddings无法正常工作的原因。

请检查以下link


0
投票

请从风格中删除高度道具

input: {
  paddingBottom: 0, 
  fontSize: 18,  
  color: '#000', 
  borderBottomWidth: 1.5,    
},

我认为它会对你有所帮助

如果你想设置请至少设置为40

© www.soinside.com 2019 - 2024. All rights reserved.