반응형
기본 리액션에서 텍스트에 스트라이크를 추가하는 방법?
이봐, 나는 삭감된 금액을 보여주는 10달러의 금액에 스트라이크 스루를 추가하고 싶어.아래를 확인하십시오.
<View style={styles.row}>
<View style={styles.inputWrapstotal}>
<Text style={styles.labelcolor}>16.7% Off</Text>
</View>
<View style={styles.inputWrapstotal}>
<Text style={styles.labelamount}>Rs $10</Text>
<Text style={styles.labelamountchange}> 12 </Text>
</View>
</View>
css를 추가해서 내가 두 텍스트의 줄에 맞출 수 있게 해줘, 미리 고마워.
이미지를 확인하십시오.
포함:
<Text style={{textDecorationLine: 'line-through', textDecorationStyle: 'solid'}}>
Solid line-through
</Text>
<Text style={{ textDecorationLine: 'line-through' }}>Strike through text</Text>
공식 설명서에서 더 많은 텍스트 스타일링 옵션을 찾을 수 있음
사용할 수 있다textDecorationLine
다음과 같은 '라인 스루(line-through)' 속성의 경우:
<Text style={{ textDecorationLine: 'line-through' }}>$12</Text>
그것은 당신의 문자 위에 선을 그릴 것이다!
그래서 당신은 이것을 성취하기를 원하십니까?
<Text style={styles.oldPrice}>$19.19</Text>
텍스트 구성요소에 이 스타일을 전달하십시오.
const styles = StyleSheet.create({
oldPrice: {
textDecorationLine: 'line-through',
textDecorationStyle: 'solid',
},
});
참조URL: https://stackoverflow.com/questions/45833682/how-to-add-strike-through-on-text-in-react-native
반응형
'programing' 카테고리의 다른 글
각도 4 Ngx-datable Filter 미작동 객체가 null이지만 액세스됨(조건이 있는 경우에도) (0) | 2022.03.27 |
---|---|
경로에 @를 추가하는 방법 nuxtjs.예: example.com/@properties (0) | 2022.03.27 |
Python 3에서 "100000000000000000000001"이 왜 그렇게 빠른가? (0) | 2022.03.27 |
VS Code를 사용하여 .vue 파일의 Typecript를 사용하는 방법 (0) | 2022.03.27 |
Vue.js - 알 수 없는 사용자 지정 요소: (0) | 2022.03.27 |