[英]How to add strike through on Text in react native?
嘿,我想以 10 美元的金額添加 Strike Through 以顯示削減金額。 請檢查以下內容:
<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 textDecorationLine="line-through" fontSize={12}>${price}</Text>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.