如何删除下划线的反应天然材料文本字段
问题描述:
我使用的是原生的反应文本字段部件如何删除底下划线的文本框如何删除下划线的反应天然材料文本字段
这是我的代码 我跟着这个链接:https://github.com/n4kz/react-native-material-textfield
constructor(props) {
super(props);
this.state = {
userName:'',
password:''
}
}
componentWillMount() {
}
componentDidMount(){
}
render() {
//let { userName } = this.state;
let { password } = this.state;
return (
<View style={{flex:1,justifyContent:'center'}}>
<View style={{flex:0.2,justifyContent:'center',flexDirection:'row'}}>
<View style={{flex:12}}></View>
<View style={{flex:76,borderWidth:1,borderColor:'black',borderRadius:5,marginBottom:13.7}}>
<TextField style={{ color: 'black',borderColor:'transparent'}}
label='Phone number'
textColor={'black'}
value={this.state.userName}
labelHeight={40}
labelPadding={8}
padding={10}
Bottom padding= {10}
Top padding={4}
//width={50}
//borderColor={'black'}
// textFocusColor={'orange'}
//underlineColorAndroid='transparent'
baseColor={"black"}
labelHeight={32}
blurOnSubmit={true}
//characterRestriction={10}
onChangeText={(data) => this.setState({ userName: data })}
/>
</View>
)
}
答
您可以尝试underlineColorAndroid='rgba(0,0,0,0)'
希望它可以帮助
答
个其他的TextInput性能也将工作
阵营原生材料文本字段组件(<TextField />
)也可以使用所有属性的从文本输入元件(<TextInput />
)。因此,您可以使用underlineColorAndroid
道具删除下划线边框。设置此道具为透明。
<TextField underlineColorAndroid="transparent" />
误读,抱歉编辑。 – MattyK14
没关系。谢谢 – wlisrausr