A Microsoft framework for building cross-platform mobile apps using .NET and C# with native performance and user interfaces.
Hello,
Welcome to our Microsoft Q&A platform!
You can try to use the following code to hide or show keyboard for your EditText(s) in your app programmatically, it could re-pan the app content.
var btn_show = FindViewById<Button>(Resource.Id.btn_show);
var btn_hide = FindViewById<Button>(Resource.Id.btn_hide);
EditText editText1 = FindViewById<EditText>(Resource.Id.editText1);
InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
btn_show.Click += delegate
{
if (imm != null)
{
editText1.RequestFocus();
imm.ShowSoftInput(editText1, 0);
}
};
btn_hide.Click += delegate
{
if (imm != null)
{
imm.HideSoftInputFromWindow(editText1.WindowToken, 0);
editText1.ClearFocus();
}
};
}
Here is running screenshot. If it is not your need, could you share a video or GIF about your issue?
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.