반응형
배경색으로 네이티브 테두리 반경 반응
React Native에서 borderRadius
작동하지만 버튼에 지정된 배경색이 정사각형으로 유지됩니다. 여기서 무슨 일이 일어나고 있습니까?
JS
<TouchableHighlight
style={styles.submit}
onPress={() => this.submitSuggestion(this.props)}
underlayColor='#fff'>
<Text style={[this.getFontSize(),styles.submitText]}>Submit</Text>
</TouchableHighlight>
스타일
...
submit:{
marginRight:40,
marginLeft:40,
marginTop:10,
},
submitText:{
paddingTop:20,
paddingBottom:20,
color:'#fff',
textAlign:'center',
backgroundColor:'#68a0cf',
borderRadius: 10,
borderWidth: 1,
borderColor: '#fff'
},
...
버튼 스타일을 TouchableHighlight
자체로 이동해보십시오 .
스타일 :
submit:{
marginRight:40,
marginLeft:40,
marginTop:10,
paddingTop:20,
paddingBottom:20,
backgroundColor:'#68a0cf',
borderRadius:10,
borderWidth: 1,
borderColor: '#fff'
},
submitText:{
color:'#fff',
textAlign:'center',
}
버튼 (동일) :
<TouchableHighlight
style={styles.submit}
onPress={() => this.submitSuggestion(this.props)}
underlayColor='#fff'>
<Text style={[this.getFontSize(),styles.submitText]}>Submit</Text>
</TouchableHighlight>
overflow: hidden
스타일에 추가 해야합니다.
Js :
<Button style={styles.submit}>Submit</Button>
스타일 :
submit {
backgroundColor: '#68a0cf';
overflow: 'hidden';
}
아래 코드 줄을 적용하십시오.
<TextInput
style={{ height: 40, width: "95%", borderColor: 'gray', borderWidth: 2, borderRadius: 20, marginBottom: 20, fontSize: 18, backgroundColor: '#68a0cf' }}
// Adding hint in TextInput using Placeholder option.
placeholder=" Enter Your First Name"
// Making the Under line Transparent.
underlineColorAndroid="transparent"
/>
참고 URL : https://stackoverflow.com/questions/35030758/react-native-border-radius-with-background-color
반응형
'IT TIP' 카테고리의 다른 글
여러 줄 텍스트 상자에 maxlength 지정 (0) | 2020.10.20 |
---|---|
mysql LIKE가 대소 문자를 구분하도록 어떻게 강제합니까? (0) | 2020.10.20 |
Bootstrap 4 반응 형 테이블은 너비를 100 % 차지하지 않습니다. (0) | 2020.10.20 |
자기를 사용합니다. (0) | 2020.10.20 |
파이프 라인 입력을 허용하는 PowerShell 스크립트를 작성하려면 어떻게해야합니까? (0) | 2020.10.20 |