Forked from awatertrevi/NoRippleListViewRenderer.cs
Created
January 17, 2018 03:38
-
-
Save mecvillarina/6b152d59510da643f82d252bdad067e2 to your computer and use it in GitHub Desktop.
Removes the material ripple effect on the Xamarin.Forms Android ListView.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_window_focused="false" android:drawable="@android:color/transparent"/> | |
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Android.App; | |
using Android.Content; | |
using Android.OS; | |
using Android.Runtime; | |
using Android.Views; | |
using YourProject.Droid.CustomRenderers; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.Android; | |
[assembly: ExportRenderer (typeof(ListView), typeof(NoRippleListViewRenderer))] | |
namespace YourProject.Droid.CustomRenderers | |
{ | |
public class NoRippleListViewRenderer : ListViewRenderer | |
{ | |
protected override void OnElementChanged(ElementChangedEventArgs<ListView> e) | |
{ | |
base.OnElementChanged(e); | |
Control.SetSelector(Resource.Layout.no_selector); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment