UWP to determine whether Windows Mobile uses entity keys or virtual keys

Source: Internet
Author: User

Original: UWP Determines whether Windows Mobile uses entity keys or virtual keys

Recently in the Write startup screen, found that the virtual button will block, start the bottom of the screen element, about a few px. But is there any way to know whether the mobile phone is a physical key or a virtual key?

Such as. You can see that the red part shows a little bit. The code is set to 60px.

Searched the internet for a long time. Have not found any API to view. Suddenly in the heart began to scold Ms.

Various forums for various inquiries.

Finally there was an engine oil that answered

Tried it. Well.. The virtual keys will disappear when full screen is removed. But.. That's not what I want.

All of a sudden a flash of inspiration. Remembered that there was such a thing. Applicationview.getforcurrentview (). Visiblebounds

So debug a look. Hey, heh. Finally find the things you want.

 DoubleStatusbarheight =0; if(Apiinformation.istypepresent ("Windows.UI.ViewManagement.StatusBar")) Statusbarheight=Statusbar.getforcurrentview (). Occludedrect.height;//Gets the visible region of the window (app view). The visible region was the region//Not occluded by chrome such as the status bar and app bar. varVisiblebounds =Applicationview.getforcurrentview (). Visiblebounds;varVirtualbuttonheight = Extendedsplashimage.height-visiblebounds.height-statusbarheight;

The height of the last virtual key = splashscreen Height-visiblebounds.height-statusbarheight.

1520 Solid keys and 950XL virtual key test pass:

Finally, then spit the groove under Ms. When do you get out of your surface phone? Faith is exhausted.

UWP to determine whether Windows Mobile uses entity keys or virtual keys

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.