Skip to content

Instantly share code, notes, and snippets.

@jessejiang0214
Created January 25, 2016 05:30
Show Gist options
  • Save jessejiang0214/63b29b3166330c6fc083 to your computer and use it in GitHub Desktop.
Save jessejiang0214/63b29b3166330c6fc083 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(MyAPP.iOS.CustomAllViewCellRendereriOS))]
namespace MyAPP.iOS
{
public class CustomAllViewCellRendereriOS : 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>
@guilhermereisti
Copy link

Very good! Thank you!

@H-MAli
Copy link

H-MAli commented Mar 14, 2021

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment