Решил мою проблему, вызвав метод для фокусировки на пользовательских средствах визуализации
Пользовательский ввод:
public class AutoFocusEntry : Entry
{
public AutoFocusEntry()
{
}
}
}
CustomRenderer в Android:
[assembly: ExportRenderer(typeof(AutoFocusEntry), typeof(AutoFocusEntryRenderer))]
namespace Test.Mobile.Droid.CustomRenderers
{
public class AutoFocusEntryRenderer : EntryRenderer
{
public AutoFocusEntryRenderer(Context context) : base(context)
{
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
MocoAutoFocusEntry entry = (MocoAutoFocusEntry)this.Element;
if (this.Control != null && e.PropertyName == "IsVisible")
{
if (entry != null && entry.IsVisible)
{
Control.RequestFocus();
InputMethodManager inputMethodManager = this.Control.Context.GetSystemService(Android.Content.Context.InputMethodService) as InputMethodManager;
inputMethodManager.ShowSoftInput(this.Control, ShowFlags.Forced);
inputMethodManager.ToggleSoftInput(ShowFlags.Forced, HideSoftInputFlags.ImplicitOnly);
}
}
}
}
}
CustomRenderer в iOS:
[assembly: ExportRenderer(typeof(AutoFocusEntry), typeof(AutoFocusEntryRenderer))]
namespace Test.Mobile.iOS.CustomRenderers
{
public class AutoFocusEntryRenderer : EntryRenderer
{
public AutoFocusEntryRenderer()
{
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
MocoAutoFocusEntry entry = (MocoAutoFocusEntry)this.Element;
if (this.Control != null && e.PropertyName == "IsEnabled")
{
if (entry != null && entry.IsVisible)
{
Control.BecomeFirstResponder();
}
}
if (this.Control != null && e.PropertyName == "IsVisible")
{
if (entry != null && entry.IsVisible)
{
Control.BecomeFirstResponder();
}
}
}
}
}
На основании PropertyName (IsVisible & IsEnabled) я получаю фокус на запись