UWP determines whether windows mobile uses an object key or a virtual key. uwpmobile

Source: Internet
Author: User

UWP determines whether windows mobile uses an object key or a virtual key. uwpmobile

Recently I was writing a boot screen and found that the virtual button would block it. The bottom element of the boot screen is about 50 px. But is there any way to know whether the mobile phone uses an entity key or a virtual key?

For example. The red part shows a little bit. The Code sets 60px.

I have been searching online for a long time. No APIs are found. In an instant, I began to scold ms ..

Various inquiries in various forums.

Finally, an oil was answered

I tried it .. Well .. The virtual keys will disappear in full screen mode .. But .. This is not what I want ..

All of a sudden .. Think of such a thing. ApplicationView. GetForCurrentView (). VisibleBounds

So let's take a look at debug .. Hey. Finally find what you want ..

 double statusbarHeight = 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 is the region //not occluded by chrome such as the status bar and app bar.   var visibleBounds = ApplicationView.GetForCurrentView().VisibleBounds;var virtualButtonHeight = extendedSplashImage.Height - visibleBounds.Height - statusbarHeight;

The final Height of the virtual key = the Height of the SplashScreen-VisibleBounds. Height-statusbarHeight.

1520 entity keys and 950XL virtual keys passed the test ..

Finally, let's talk about the ms .. When is the surface phone. All faith is used up ..

 

Related Article

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.