protected override void OnAttached() { try { EditText editText; # region Material Design if (Control is TextInputLayout inputLayout) { editText = inputLayout.EditText; } #endregion else if (Control is EditText text) { editText = text; } else { return; } editText.ShowSoftInputOnFocus = KeyboardEffect.GetEnableKeyboard(Element); if (!editText.ShowSoftInputOnFocus) { editText.FocusChange += HideMethod; } var requestFocus = KeyboardEffect.GetRequestFocus(Element); if (requestFocus) { editText.RequestFocus(); } }
protected override void OnAttached() { try { if (!(Control is UITextField nativeTextField) || KeyboardEffect.GetEnableKeyboard(Element)) { return; } nativeTextField.InputView = new UIView(); nativeTextField.InputAssistantItem.LeadingBarButtonGroups = null; nativeTextField.InputAssistantItem.TrailingBarButtonGroups = null; var requestFocus = KeyboardEffect.GetRequestFocus(Element); if (requestFocus) { nativeTextField.BecomeFirstResponder(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); } }
protected override void OnDetached() { try { if (!(Control is UITextField nativeTextField)) { return; } nativeTextField.InputView = null; var requestFocus = KeyboardEffect.GetRequestFocus(Element); if (requestFocus) { nativeTextField.BecomeFirstResponder(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); } }
public Task <Guid> CreateKeyboardEffectAsync <T>(KeyboardEffect effect, T data) where T : struct { Called?.Invoke(this, new MockCall(nameof(CreateKeyboardEffectAsync), data)); return(Task.FromResult(Guid.NewGuid())); }
public Task <Guid> CreateKeyboardEffectAsync(KeyboardEffect effect) { throw new NotImplementedException(); }