Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React-Native Semi-Circle View

$
0
0

I'm trying to figure out how to draw a semi-circle component. It might not even be possible in pure React, but I'm willing to try using a library. I looked around and couldn't find one that seemed to be what I'm looking for.

But rendering a circle is easy enough. In this example, I've got a circle rendering inside of another circle:

<View      style={{        width: 100,        height: 100,        borderRadius: 300,        justifyContent: "center",        alignItems: "center",        backgroundColor: "darkred",      }}><View        style={{          width: "90%",          height: "90%",          borderRadius: 300,          justifyContent: "center",          alignItems: "center",          backgroundColor: "red",        }}></View></View>

The code above renders as the circle on the left (below), but I want to be able to do something similar to the circle on the right (forgive the poor editing skills) where I can render a semi-circle at any particular arc.

Desired semi-circle


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>