borderRadius is the opposite of react native

1k Views Asked by At

I have a problem how can I use react native styles as shown below?

Image 1:I have a solution that is separating 2 rectangles and its borderRadius but how do borderRadius compare to its default?

enter image description here

enter image description here

Image2: ....

enter image description here

1

There are 1 best solutions below

0
On

As far as I know ReactNative does not support this "inverted" border radius. Some people achieve something similar to this using other Views as "Masks", there's a quite similar usecase as yours in this question:

https://stackoverflow.com/a/59082965/2719629

They got quite the expected result, but without the shadow.

One other option I would suggest is to use a svg between the two rectangles but that may be quite trick to implement, and svg's shadows don't work well with android as well.