gpt4 book ai didi

react-native - 防止 TextInput 字段中的文本滚动和截断

转载 作者:行者123 更新时间:2023-12-04 11:56:01 25 4
gpt4 key购买 nike

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

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



样式 Prop 如下:

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

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

最佳答案

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

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

请检查以下link

关于react-native - 防止 TextInput 字段中的文本滚动和截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55173363/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com