Image tag not display svg image URL

Bhuwan 881 Reputation points
2024-02-02T19:29:32.13+00:00

I am trying to display svg image url in Image tag source but it's not working
Binding privacyurl is SVG image url

<Image 
        HorizontalOptions="FillAndExpand"
        VerticalOptions="CenterAndExpand"
        Source="{Binding privacyurl}" Aspect="AspectFit" WidthRequest="{OnIdiom Phone=120,Tablet=180}" HeightRequest="{OnIdiom Phone=45,Tablet=90}">
Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2024-02-05T06:50:33.2133333+00:00

    Hello,

    Image control cannot show the SVG file url, and this issue was reported in the MAUI Github repo. See: Load an SVG from web URL #10050.

    Here are workarounds to show the SVG from URL.

    1. Use webview to show it directly.
    2. Create a custom view that extend the SKCanvasView to show the svg file, see this content.

    Best Regards, Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.