0

I'm trying to make fullscreen scene with "react-native-svg" library. That's my component render code:

<Svg viewBox="0 0 100 100" height="100%">
    <Rect
        x="25"
        y="25"
        width="50"
        height="50"
        stroke="red"
        strokeWidth="2"
        fill="yellow"
    />
</Svg>

That's what I'm wanna to get: enter image description here

But what I'm have in a landscape mode:

enter image description here

And the most important thing. the block is normalized when the resize event occurs:

enter image description here

1 Answers1

0

Fixed by

    const viewBox = '0 0 '+this.state.screenWidth+' '+this.state.screenHeight;
    return <Svg viewBox={viewBox} style={styles.wrapper}>

I think itsn't the best solution, but it's work