是否有一个教程或基本的解释,其中记录了如何管理Windows 10中的软输入面板(SIP)以适应视图控件?
基本上,现在当虚拟键盘出现在我的Windows 10手机应用程序中时,它隐藏了文本框和底部工具栏。我需要重新容纳视图的控件,但是我不能提供关于事件、模式等的信息
参见:响应触摸键盘
例如: protected override void OnNavigatedTo(NavigationEventArgs e)
{
mInputPane = InputPane.GetForCurrentView();
mInputPane.Showing += InputPane_Showing;
mInputPane.Hiding += InputPane_Hiding;
}
.
private void InputPane_Showing(InputPane sender, InputPaneVisibilityEventArgs args)
{
// Keyboard showing, get the size of the keyboard and adjust view.
double keyboardHeight = args.OccludedRect.Height;
aGridRow.Height = new GridLength(keyboardHeight);
// Inform the system we have handled making the required UI visible.
args.EnsuredFocusedElementInView = true;
}
.
private void InputPane_Hiding(InputPane sender, InputPaneVisibilityEventArgs args)
{
// Keyboard has disappeared, reset the view.
aGridRow.Height = new GridLength(0);
args.EnsuredFocusedElementInView = true;
}