gpt4 book ai didi

ios - React Native TextInput 总是有黑色边框

转载 作者:行者123 更新时间:2023-12-03 14:21:05 27 4
gpt4 key购买 nike

我在 React Native 中使用 TextInput,如果我尝试向组件添加边框,则在我的彩色边框顶部总会有一个方形黑色边框。

enter image description here

当我删除彩色边框时,组件看起来像这样:

enter image description here

这是我的代码:

<TextInput
returnKeyType="search"
style={searchStyle.searchInput}
onChangeText={(text) => this.setState({text})}
placeholder={this.state.searchText}
onSubmitEditing={(event) => this.searchLocationSubmit(event)}
/>

const searchStyle = StyleSheet.create({
searchInput : {
height: 35,
color: '#64AFCB',
borderColor: '#64AFCB',
borderWidth: 1,
borderStyle: 'solid',
borderRadius: 15,
width: 200,
marginLeft: 10,
marginTop: 10,
backgroundColor: 'white',
position: 'absolute',
zIndex: 2
}
})

最佳答案

尝试删除 borderStyle: 'solid'

关于ios - React Native TextInput 总是有黑色边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40558816/

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