[Xamarin.Forms] Problem loading SVG image on iOS
See original GitHub issueI’m using the latest prerelease available Xamarin.FFImageLoading.Svg.Forms 2.2.10-pre-390 together with Xamarin.Forms 2.3.4.231.
Here is the XAML code used:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:ffimageloadingsvg="clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms"
x:Class="App.Views.MainPage">
<ContentPage.Content>
<ffimageloadingsvg:SvgCachedImage
WidthRequest="200"
HeightRequest="200"
Source="http://s.cdpn.io/3/kiwi.svg"/>
</ContentPage.Content>
</ContentPage>
Error:
Xamarin.Forms.Xaml.XamlParseException: Position 13:14. Type ffimageloadingsvg:SvgCachedImage not found in xmlns clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms
To solve the problem here it was necessary to reference the SvgCachedImage assembly in the AppDelegate:
var svgAssembly = typeof(SvgCachedImage).GetTypeInfo().Assembly;
CachedImageRenderer.Init();
The same was not needed on Android. Everything worked as expected.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top Results From Across the Web
svg image is not loading in xamarin
i am trying to load svg image but nothing shows up. I set image to embedded resources and path of image is: enter...
Read more >How To: SVG as an iOS image asset in Xamarin!
Go to [your Xamarin iOS project] -> Assets.xcassets -> [name of asset].imageset folder and replace your placeholder *.pdf file with *.svg file.
Read more >Displaying SVGs in Xamarin.Forms - Damir's Corner
It can create an ImageSource from an SVG so that it can be rendered by Image view just like other image formats. I...
Read more >Support SVG image for Xamarin.Form | by Angel iT - Medium
I have just need to install FFImageLoading library that support load & transform SVG image to UIImage, and then bind it to PhotoBrowser...
Read more >Cross-Platform Images in Xamarin.Forms Using SVGs
Forms project where almost every image used has been an SVG shared between both the iOS and the Android platform apps.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Created a bug into Xamarin bug tracking system as the Release build is different than the Debug one. https://bugzilla.xamarin.com/show_bug.cgi?id=60653
I solved it by adding FFImageLoading.Svg.Forms.SvgCachedImage.Init(); In any case, since “var ignore = typeof(FFImageLoading.Svg.Forms.SvgCachedImage);” was present, I think there is still an issue in the Release build in Xamarin.