PM-3350 Migrated the CustomViewCellRenderer for iOS
This commit is contained in:
parent
8c623a2067
commit
455c3a257c
|
@ -5,7 +5,7 @@ using UIKit;
|
|||
|
||||
namespace Bit.iOS.Core.Handlers
|
||||
{
|
||||
//This is a Compatibility verion of the NavigationRenderer. Eventually we should see if there's a better way to implement this behavior.
|
||||
//This is a Compatibility version of the NavigationRenderer. Eventually we should see if there's a better way to implement this behavior.
|
||||
public class CustomNavigationHandler : Microsoft.Maui.Controls.Handlers.Compatibility.NavigationRenderer
|
||||
{
|
||||
public override void PushViewController(UIViewController viewController, bool animated)
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
using Bit.App.Utilities;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Core.Handlers
|
||||
{
|
||||
//This is a Compatibility version of the ViewCellRenderer. Eventually we should see if there's a better way to implement this behavior.
|
||||
public class CustomViewCellHandler : Microsoft.Maui.Controls.Handlers.Compatibility.ViewCellRenderer
|
||||
{
|
||||
private bool _noSelectionStyle = false;
|
||||
|
||||
public CustomViewCellHandler()
|
||||
{
|
||||
_noSelectionStyle = !(ThemeManager.GetResourceColor("BackgroundColor").Equals(Colors.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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -47,6 +47,7 @@ namespace Bit.iOS.Core.Utilities
|
|||
{
|
||||
handlers.AddHandler(typeof(TabsPage), typeof(Handlers.CustomTabbedHandler));
|
||||
handlers.AddHandler(typeof(NavigationPage), typeof(Handlers.CustomNavigationHandler));
|
||||
handlers.AddHandler(typeof(ViewCell), typeof(Handlers.CustomViewCellHandler));
|
||||
handlers.AddHandler(typeof(ContentPage), typeof(Handlers.CustomContentPageHandler));
|
||||
Handlers.ButtonHandlerMappings.Setup();
|
||||
Handlers.DatePickerHandlerMappings.Setup();
|
||||
|
|
Loading…
Reference in New Issue