How to automatically select all text on focus in Entry,Editor,Label? Use Cross Platforms.
Quantity.IsFocused = true;
No work :(
In MainActivity add
public class MyEntryRenderer : EntryRenderer
{
public MyEntryRenderer(Context ctx) : base(ctx) {}
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if (e.OldElement == null)
{
var nativeEditText = (EditText)Control;
nativeEditText.SetSelectAllOnFocus(true);
}
}
}
and to the top add :
[assembly: ExportRenderer (typeof (Entry), typeof (MyEntryRenderer))]