react-native-text-gradient icon indicating copy to clipboard operation
react-native-text-gradient copied to clipboard

It is giving error that text field must be inside the text component and when i add the text in text component it does not takes the styling from LinearTextGradient

Open shivams10 opened this issue 2 years ago • 4 comments

I m tring this in my android studio.

shivams10 avatar Jun 05 '23 10:06 shivams10

same error

acarkaan avatar Oct 22 '23 17:10 acarkaan

@acarkaan , you can use MaskedView from '@react-native-masked-view/masked-view' it worked for me.

shivams10 avatar Oct 24 '23 07:10 shivams10

@acarkaan , you can use MaskedView from '@react-native-masked-view/masked-view' it worked for me.

Thank you very much i will use this package too.

acarkaan avatar Oct 24 '23 12:10 acarkaan

The most simple way to to avoid this issue is that <LinearTextGradient style={{fontWeight: 'bold', fontSize: 72}} locations={[0, 1]} colors={['red', 'blue']} start={{x: 0, y: 0}} end={{x: 1, y: 0}}> <Text>Hello World</Title> </LinearTextGradient>

Just enclose the string/text in <Text></Text> and apply the styling on that just not the color adjust the color through
<><><><><><><> <LinearTextGradient style={{fontWeight: 'bold', fontSize: 72}} locations={[0, 1]} colors={['red', 'blue']} start={{x: 0, y: 0}} end={{x: 1, y: 0}}> <><><><><><><>

The above part!

waleedauthornate avatar Aug 15 '24 05:08 waleedauthornate