1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-05 10:03:26 +00:00

fix cursor color to renderers

This commit is contained in:
Kyle Spearrin
2019-06-26 10:20:42 -04:00
parent dd4561d985
commit 2d91a893f7
3 changed files with 26 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
using Bit.iOS.Renderers;
using System.ComponentModel;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
@@ -18,7 +19,22 @@ namespace Bit.iOS.Renderers
// Remove padding
Control.TextContainerInset = new UIEdgeInsets(0, 0, 0, 0);
Control.TextContainer.LineFragmentPadding = 0;
UpdateTintColor();
}
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if(e.PropertyName == Editor.TextColorProperty.PropertyName)
{
UpdateTintColor();
}
}
private void UpdateTintColor()
{
Control.TintColor = Element.TextColor.ToUIColor();
}
}
}

View File

@@ -16,6 +16,7 @@ namespace Bit.iOS.Renderers
if(Control != null && e.NewElement is Entry)
{
Control.ClearButtonMode = UITextFieldViewMode.WhileEditing;
UpdateTintColor();
UpdateFontSize();
iOSHelpers.SetBottomBorder(Control);
}
@@ -30,6 +31,10 @@ namespace Bit.iOS.Renderers
{
UpdateFontSize();
}
else if(e.PropertyName == Entry.TextColorProperty.PropertyName)
{
UpdateTintColor();
}
}
private void UpdateFontSize()
@@ -47,5 +52,10 @@ namespace Bit.iOS.Renderers
}
}
}
private void UpdateTintColor()
{
Control.TintColor = Element.TextColor.ToUIColor();
}
}
}