1

I am trying to do this by using the green background like an image, but I need to do it via styling. Can someone guide me on how to do this without using the image?

enter image description here

2 Answers 2

4

You have to make it's position absolute, make the zIndex high, and then take use of transform (https://reactnative.dev/docs/transforms) to rotate it the way you want.

Super short example of using these things,

<View style{{position:"absolute",top:0,bottom:0,left:0, right:0,zIndex:10, backGroundColor:"green", transform: [{ rotate: "45deg" }]] }}> </View> 
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. It helped me learn a new concept
2

Short Answer: Not sure if there is a solid way to do that just with RN styles.
I was thinking that we can use these CSS tricks so I tried them here but it's not working on Android. If I want to do that, I would use react-native-svg as you are free to draw whatever you want.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.