2017-09-07 6 views
0

내가이 내 코드 입니다에서 밑줄 제거 내가이 링크를 따라 내가 사용

텍스트 필드에 아래 밑줄을 제거하는 방법 기본 텍스트 필드 구성 요소를 반응 기본 소재 텍스트 필드에 반응하는 방법 : 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> 
    ) 
} 

답변

2

당신은 underlineColorAndroid='rgba(0,0,0,0)'

그것이

2
희망이 도움 시도 할 수 있습니다3210 개

다른 TextInput 구성 특성은

참조 작동합니다 : https://github.com/n4kz/react-native-material-textfield

는 기본 재료 텍스트 필드 구성 요소 (<TextField />를) 반작용 또한 텍스트 입력 구성 요소 (<TextInput />)에서 모든 속성을 사용할 수 있습니다. 따라서 underlineColorAndroid 소품을 사용하여 밑줄 경계선을 제거 할 수 있습니다. 이 받침대를 투명으로 설정하십시오.

<TextField underlineColorAndroid="transparent" /> 
+0

Misread, 죄송합니다. – MattyK14

+0

괜찮습니다. 감사 – wlisrausr