Resuelto: cambiar el color de tachado a través de la línea de texto en reaccionar nativo

El principal problema de cambiar el color de una línea de texto tachada en React Native es que puede ser difícil lograr el efecto deseado.

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>

Reaccionar texto tachado nativo usando la hoja de estilo

En React Native, puede usar la propiedad styleSheet de un componente de texto para aplicar estilos al texto.

Para usar la propiedad styleSheet, primero debe crear un objeto StyleSheet. Luego, puede usar la propiedad styleSheet para aplicar estilos al texto.

Aquí hay un ejemplo de cómo usar la propiedad styleSheet para aplicar estilos al texto en React Native:

Este es un texto con estilos.

Artículos Relacionados:

Deja un comentario