0

I have used SVGKit library to show svg images but the is some extra numbering in the images.

Here is the actual image:

enter image description here

But the image shown in the imageView looks like this:

enter image description here

As you can see in second image the numbers are showing on top and bottom in bunches are not part of the original image.

How do I resolve this issue.I am using the svg image first time so I don't know the reason behind this.

Here is the code to show svg image from url:

let svgURL = URL(string: imageUrl)
let data = try? Data(contentsOf: svgURL)
let receivedIcon: SVGKImage = SVGKImage(data: data)
                        self.svgImageView.image = receivedIcon.uiImage
4

1 回答 1

0

你的代码很好。如果 SVG 图像没有问题,图像肯定会显示。问题不在于 WKWebView,问题在于 SVG 图像的编码。我们知道 SVG 是由 html css 代码组成的......,尝试修复那个 css 部分。

另外请在浏览器中打开您的图片链接并尝试降低窗口的宽度高度,如果存在 css 问题,您的图片肯定会显示失真。

也关注这个问题

于 2020-05-11T09:01:42.030 回答