Skip to content

Instantly share code, notes, and snippets.

@JigarM
Last active September 8, 2018 10:08
Show Gist options
  • Save JigarM/df9278b6f1d0e3dcb2920426e03d5049 to your computer and use it in GitHub Desktop.
Save JigarM/df9278b6f1d0e3dcb2920426e03d5049 to your computer and use it in GitHub Desktop.
Disable Xamarin Forms ListView select item HightLight color
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer (typeof(ViewCell), typeof(App.iOS.ExtendedViewCellRenderer))]
namespace App.iOS
{
public class ExtendedViewCellRenderer : ViewCellRenderer
{
public override UIKit.UITableViewCell GetCell (Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv)
{
var cell = base.GetCell (item, reusableCell, tv);
if (cell != null)
cell.SelectionStyle = UIKit.UITableViewCellSelectionStyle.None;
return cell;
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="CustomTheme" parent="android:Theme.Holo.Light">
<item name="android:colorActivatedHighlight">@android:color/transparent</item>
</style>
</resources>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment