1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 08:13:20 +00:00

no listview selection type on non-light theme

This commit is contained in:
Kyle Spearrin
2019-06-24 16:16:17 -04:00
parent 94fbf627ba
commit 88b8a192b5
3 changed files with 32 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
using Bit.iOS.Renderers;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(ViewCell), typeof(CustomViewCellRenderer))]
namespace Bit.iOS.Renderers
{
public class CustomViewCellRenderer : ViewCellRenderer
{
private bool _noSelectionStyle = false;
public CustomViewCellRenderer()
{
_noSelectionStyle = (Color)Xamarin.Forms.Application.Current.Resources["BackgroundColor"] != Color.White;
}
public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
{
var cell = base.GetCell(item, reusableCell, tv);
if(_noSelectionStyle)
{
cell.SelectionStyle = UITableViewCellSelectionStyle.None;
}
return cell;
}
}
}