无法在React Native中删除TextInput的底部边框

时间:2018-12-30 17:30:07

标签: react-native

  

我是React Native的新手,我无法隐藏TextInput的边框。   版本:0.55   我正在给我的屏幕。

我想要这个: enter image description here

最后我得到了: enter image description here

此屏幕的相应代码为:-

JSX:-

<View style={styles.emailContainer}>
  <View style={styles.commonInput}>
    <TextInput style={{ paddingLeft: 15, }} placeholder="Email" />
  </View>
  <View style={styles.emailIcon}>
    <Image
      style={{ width: 20, height: 20 }}
      source={require('../../assets/images/envelope.png')}
    />
  </View>
</View>

样式代码:-

emailContainer: {
  flexDirection: "row",
  backgroundColor: '#ffffff',
  height: 40,
  marginTop: 25,
  marginRight: 10,
  marginLeft: 10,       
  borderRadius: 15,
  backgroundColor: '#ffffff'
},
emailIcon: {
  justifyContent: 'center',
  alignContent: 'center',
  justifyContent:'center'
},
commonInput: {
  width: '90%'
}

如何从textInput删除底部边框? 谢谢。

1 个答案:

答案 0 :(得分:2)

只需将TextInput的standard属性设置为underlineColorAndroid或输入字段的背景色即可。

代码应类似于:

transparent