Kuxazululiwe: shintsha umbala wesiteleka ngomugqa wombhalo ngokusabela komdabu

Isibuyekezo sokugcina: 09/11/2023

Inkinga enkulu ngokushintsha umbala wesiteleka ngomugqa wombhalo ku-React Native ukuthi kungaba nzima ukuzuza umphumela ofisa ukuwufinyelela.

I have a text component in React Native and I want to change the color of the strike through line. How can I do this?


A:

You can use the <code>textDecorationColor</code> style property: https://facebook.github.io/react-native/docs/text-style-props#textdecorationcolor
<code>&lt;Text style={{ textDecorationLine: 'line-through', textDecorationColor: 'red' }}&gt;Hello world!&lt;/Text&gt;</code>

Phendula Umbhalo Womdabu Wokushaya Usebenzisa Ishidi Lesitayela

Nge-React Native, ungasebenzisa isici Seshidi lesitayela sengxenye yombhalo ukuze usebenzise izitayela embhalweni.

Ukuze usebenzise isici Seshidi Lesitayela, okokuqala udinga ukudala into yeStyleSheet. Bese, ungasebenzisa isici Seshidi lesitayela ukuze usebenzise izitayela ekubhaleni.

Nasi isibonelo sendlela yokusebenzisa isici Seshidi lesitayela ukuze usebenzise izitayela kumbhalo othi React Native:

Lona omunye umbhalo onezitayela

Okuthunyelwe okuhlobene:

Shiya amazwana