Sunday, December 15, 2024
HomeiOS Developmentios - Massive SVG renders weirdly in SwiftUI

ios – Massive SVG renders weirdly in SwiftUI


I’ve been utilizing an Picture view in SwiftUI to render an SVG that I’ve added to my property folder

These are the picture’s properties

SVG image SwiftUI

On the internet or in preview on my mac, it appears to be like as follows:

SwiftUI SVG rendering

Nevertheless, when the identical SVG picture renders on my gadget or simulator as follows:

SwiftUI SVG renders distorted, tiled

For some cause it will get warped, tiled or distorted – no matter the precise phrase is for this.

I’ve used SVGs prior to now however it all the time rendered usually.

The SVG is sort of massive – about 7MB.

And that is my code:

Picture("imageName")
    .resizable()
    .aspectRatio(contentMode: .match)
    .body(maxWidth: .infinity)
    .body(peak: 294)

Any thought what could possibly be going unsuitable

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments