FFImageLoading - Xamarin Android, set TintTransformation for svg

394 views Asked by At

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

1

There are 1 answers

0
ʞᴉɯ On BEST ANSWER

Solved by me:

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