2017-09-24 7 views
4

dans mon site j'ai un titre avec cette ombre du texte:ombre du texte dans React natif

h1.title { 
 
text-shadow: -1px 1px 10px rgba(0, 0, 0, 0.75) 
 
}
<h1 class="title">title</h1>

Je veux faire la même chose dans mon application native réagir.

J'ai vu les propriétés:

textShadowColor color 
textShadowOffset {width: number, height: number} 
textShadowRadius number 

mais je ne sait pas comment avoir le même effet de html.

Comment puis-je faire?

Répondre

10

CSS text-shadow a la syntaxe ci-dessous,

text-shadow: h-ombre v-ombre flou rayon couleur | none | initial | inherit;

Pour obtenir un effet similaire avec le css que vous avez fourni, vous pouvez utiliser quelque chose comme ça,

// text-shadow: -1px 1px 10px rgba(0, 0, 0, 0.75) 

{ 
    textShadowColor: 'rgba(0, 0, 0, 0.75)', 
    textShadowOffset: {width: -1, height: 1}, 
    textShadowRadius: 10 
}