SVG image is not displaying in android in xamarin.forms

Praveen.BPraveen.B INMember ✭✭
edited December 2018 in Xamarin.Forms

I am trying ti display the SVG image in my xamarin.form application, there are no issues to display the SVG image in iOS but not able to display the same image in the android application.

here is my code to display the svg image
<ContentView.Resources> <ResourceDictionary> <ffimageloadingsvg:SvgImageSourceConverter x:Key="SvgImageSourceConverter"></ffimageloadingsvg:SvgImageSourceConverter> </ResourceDictionary> </ContentView.Resources> <ContentView.Content> <ffimageloadingsvg:SvgCachedImage Source="{Binding SvgFileName, Converter={StaticResource SvgImageSourceConverter}}" Grid.Column="0" WidthRequest="200" HeightRequest="600" ReplaceStringMap="{Binding BodyMapreplceStrings}" /> </ContentView.Content>

And from View Model I am binding the image as following

 public string SvgFileName
        {
            get { return _svgFileName; }
            set
            {
                _svgFileName = value;
                OnPropertyChanged();
            }
        }

and

SvgFileName="Flower.svg";

and given svg image in Resources for iOS and in Resources ->drawable

in MainActivity added following lines
CachedImageRenderer.Init(true);
var ignore = typeof(SvgCachedImage);

Is there anything I am missing?

Answers

Sign In or Register to comment.