Skip to content

Instantly share code, notes, and snippets.

@Sa1Gur
Last active June 10, 2019 17:32
Show Gist options
  • Save Sa1Gur/4331280eae6b944e7c13885c3921e4ca to your computer and use it in GitHub Desktop.
Save Sa1Gur/4331280eae6b944e7c13885c3921e4ca to your computer and use it in GitHub Desktop.
for iOS
using EntryAccent.iOS.Renderers;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(Entry), typeof(MyEntryRenderer))]
namespace EntryAccent.iOS.Renderers
{
public class MyEntryRenderer: EntryRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
TintCustomization(Control, e.NewElement as MyEntry);
}
private void TintCustomization(UITextField Control, MyEntry customEntry)
{
if (Control == null) return;
if (customEntry != null)
{
UITextField textField = Control;
textField.BorderStyle = UITextBorderStyle.None;
textField.TintColor = customEntry.MyHandleColor.ToUIColor();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment