Hi, I currently have this custom renderer for my entries, but all my entry keyboards change to numeric when I use this. How do I prevent this?
<br />
[assembly: ExportRenderer(typeof(Entry), typeof(MyEntryRenderer))]<br />
namespace (name).Droid.CustomRenderers<br />
{<br />
class MyEntryRenderer : EntryRenderer<br />
{<br />
public MyEntryRenderer(Context context) : base(context)<br />
{<br />
}</p>
<pre><code> protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
// update native EditText control to auto-select all text on focus
if (e.OldElement == null)
{
var nativeEditText = (global::Android.Widget.EditText)Control;
nativeEditText.SetSelectAllOnFocus(true);
}
if (this.Control != null)
{
// HACK:: allows commas to be used for folks in locales where comma is used as a decimal
this.Control.KeyListener = DigitsKeyListener.GetInstance("1234567890.,");
}
// setting this background color to transparent gets rid of the underline normally seen in Android edit fields
this.Control?.SetBackgroundColor(Android.Graphics.Color.Transparent);
}
}
}