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