File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -44,17 +44,19 @@ imageView.image = svg.rasterize() // 240x200
4444SVGView (" sample.svg" )
4545```
4646
47- By default, the SVG is rendered at its intrinsic size. To make it flexible within layouts, mark it as resizable — just like ` Image ` :
47+ By default, the SVG is rendered at its intrinsic size. To make it flexible within layouts, mark it as resizable:
4848
4949``` swift
5050SVGView (" sample.svg" )
5151 .resizable ()
5252 .scaledToFit ()
5353```
5454
55- - Use ` .scaledToFit() ` to scale proportionally so the SVG fits inside its container.
56- - Use ` .scaledToFill() ` to fill the entire container, cropping if necessary.
57- - Use ` .resizable(resizingMode: .tile) ` to repeat the SVG as tiles across the available space.
55+ ` SVGView ` works just like ` Image ` :
56+
57+ - ` .scaledToFit() ` to scale proportionally so the SVG fits inside its container.
58+ - ` .scaledToFill() ` to fill the entire container, cropping if necessary.
59+ - ` .resizable(resizingMode: .tile) ` to repeat the SVG as tiles across the available space.
5860
5961When loading by name, ` SVGView ` maintains an internal cache for efficient repeated lookups.
6062For more predictable performance (avoiding cache lookups or parsing), you can pass in an already-constructed ` SVG ` instance:
You can’t perform that action at this time.
0 commit comments