svgxamarin.androidffimageloading

FFImageLoading - Xamarin Android, set TintTransformation for svg


I'm able to use TintTransformation for Xamarin.Forms with this code:

        var svg = (SvgCachedImage)btn;
        var tintTransf = (TintTransformation)svg.Transformations[0];
        
        tintTransf.HexColor = color;
        svg.ReloadImage();

now i would to achieve the same result with Xamarin Android. I've tried the following code, but it does not works:

        var tintTransf = new TintTransformation(myColor);
        var load = ImageService.Instance.LoadEmbeddedResource(resourceName, assembly);
        load.Transform(tintTransf);
        load.WithCustomDataResolver(new SvgDataResolver(size, 0, true));
        
        load.Into(view);

Can you please help me? Thanks


Solution

  • Solved by me:

    var tintTransf = new TintTransformation { HexColor = myColor, EnableSolidColor = true };