sAleksovski / react-native-android-widget

Build Android Widgets with React Native
https://sAleksovski.github.io/react-native-android-widget/
MIT License
578 stars 22 forks source link

Text styling #89

Closed juliengbt closed 3 months ago

juliengbt commented 4 months ago

Hey!

Is there a way to style some specific word in a TextWidget. In react native you would do something like :

<Text>
  This is <Text style={{color: 'red'}}>red</Text> and this is <Text style={{color: 'blue'}}>blue</Text>.
</Text>

But TextWidget doesn't take any children and having multiple TextWidget in a FlexWidget (row) would not fit it the is too long.

sAleksovski commented 4 months ago

Hi.

This is currently not supported, and I'm not sure that it can be implemented easily.

You can try using the SvgWidget and the <text> element. See the examples in https://www.w3schools.com/graphics/svg_text.asp

juliengbt commented 4 months ago

Alright thanks, I'll give it a try