I'm working with Xamarin Forms ListView and trying to change the highlight color for selected item because right now for Android version, the highlighted item has black color. I'm using DataTemplate to format the ListViewItem. I tried to use ListViewRenderer class but had no success. Could you please help me with this issue? Thanks in advance.
Here is my code:
public class CustomListViewRenderer: ListViewRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.ListView> e)
{
base.OnElementChanged(e);
if (Control != null)
{
Control.ItemClick += (sender, ev) =>
{
Control.GetChildAt(ev.Position).SetBackgroundColor(Android.Graphics.Color.Beige);
};
}
}
}