我正在使用React Native中的TextInput,如果我尝试为组件添加边框,则始终会在我的彩色边框上方出现一个黑色正方形边框。
当我移除彩色边框后,该组件看起来像这样:
这是我的代码:
<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
}
})