Windows phone的键盘打开事件和属性 [英] Windows phone keyboard open events and properties

查看:147
本文介绍了Windows phone的键盘打开事件和属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Windows Phone应用程序,我需要相应地改变我的看法我的键盘。
我有几个问题:

On my Windows Phone app I need to change my view accordingly to my keyboard. I have several questions:

我怎样才能识别键盘被打开?是否有鉴于键盘打开一个事件?

How can I identify that the keyboard is opened? Is there an event on view for keyboard opening?

有没有办法让键盘的高度?
或阻塞UI的面积大小(用键盘)?

Is there a way to get the height of the keyboard? Or the area size of the blocked UI (by keyboard)?

推荐答案

您可以通过<进入键盘信息code> Windows.UI.ViewManagement.InputPane 类。有静态方法 GetForCurrentView()。它返回InputPane当前视图。 InputPane有事件隐藏显示和财产 OccludedRect 返回。区域该输入窗格中涵盖

You can access to keyboard information by Windows.UI.ViewManagement.InputPane class. There is static method GetForCurrentView(). It returns InputPane for current view. InputPane has events Hiding and Showing and property OccludedRect which returns region that input pane is covering.

InputPane inputPane = InputPane.GetForCurrentView();
inputPane.Showing += OnInputPaneShowing;
inputPane.Hiding += OnInputPaneHiding;

Rect coveredArea = inputPane.OccludedRect;

这篇关于Windows phone的键盘打开事件和属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆