gpt4 book ai didi

android - 在 Android 上更改高度时,react-native TextInput 显示错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:18:17 24 4
gpt4 key购买 nike

我有一个具有以下样式的 TextInput:

amountInput: {
flex: 1,
backgroundColor: 'rgba(255, 255, 255, 0.1)',
color: 'rgba(255, 255, 255, 0.9)',
},

在 iOS 上它正确地看起来没有足够的填充:

enter image description here

在 Android 上默认有巨大的填充:

enter image description here

没问题 - 我将设置左右内边距和高度:

amountInput: {
flex: 1,
backgroundColor: 'rgba(255, 255, 255, 0.1)',
height: 30,
paddingRight: 5,
paddingLeft: 5,
color: 'rgba(255, 255, 255, 0.9)',
}

在 iOS 上看起来不错:

enter image description here

但是 Android 搞砸了:

enter image description here

如何像倒数第二个iOS截图一样制作Android输入框?谢谢。

最佳答案

Android 在顶部和底部添加了一些默认填充,您可以通过将 paddingVertical: 0 添加到您的元素样式来重置它们。

关于android - 在 Android 上更改高度时,react-native TextInput 显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37878613/

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