I’d like to add some icons in my app especially in listviews using custom cell and specify the color to be rendered.
I don’t want to edit each image in Photoshop; I want to apply an overlay color at runtime.
Is that possible with a custom renderer?
2
Answers
No it is not possible through standard
Image
class provided in Xamarin.Forms.But you can use this amazing
IconView
custom renderer created by this guy. I use it all the time it is amazing.IconView for Xamarin Forms
Usage
Just specify the
Foreground="Red"
property colorNow We got another way with Xamarin.CommunityToolkit. We can use its
IconTintColorEffect.TintColor
for changing Tint Color or Overlay of an Image.Xamarin.CommunityToolkit is handy and provides lot of features such as Shadows on any View,
EventToCommandBehavior
for MVVMifying lot of Events and Controls, it also has additional Converters, Extensions, Helpers, and Views that are not available in builtin Xamarin Forms yet.Refer for more Documentation