简体   繁体   中英

Keyboard Behavior on ContentDialog with Windows 10 Mobile (UWP)

When I open a content dialog programmatically, the first objet catching the focus and the content dialog's shape was distorted.

Are any way available show the keyboard on the content dialog without distort the general shape ?

Thanks.

Screenshot:

在内容对话框中打开了键盘。

When the keyboard shows, the ContentDialog will adjust its height automatically. And this will cause the change of ContentDialog 's Content's height. So when the keyboard shows, the Content's height becomes small and the rest of the Content is blocked.

If you want the keyboard shows without distorting the general shape, you can set the MinHeight property of ContentDialog . For example, you can give ContentDialog a large MinHeight like "500"

<ContentDialog x:Name="contentDialog" MinHeight="500" />

Or

contentDialog.MinHeight = 500;

After this, when the ContentDialog adjust its height, its height will be 500 at least and if this height is large enough, it will not distort the general shape. You may set the MinHeight equal to ContentDialog's default height to make sure it's large enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM