Navigation buttons hiding Windows Phone 8.1

十年热恋 提交于 2020-01-11 05:16:26

问题


I'm building a Windows Phone 8.1 application, and I'm facing the following problem. There are phones that don't have hardware navigation buttons(those for back, home and search). Those phones will shrink whole UI when virtual navigation bar appears, I don't want that to happen. So what can I do to prevent this? Internet seams not to know the answer(or I haven't searched good enough). This is what I mean when I say virtual navigation buttons.


回答1:


You need to set the ApplicationViewBoundsMode to UseCoreWindow:

 ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);

The default is ApplicationViewBoundsMode.UseVisible which is your current behavior. With ApplicationViewBoundsMode.UseCoreWindow, the command bar, status bar nor the software buttons will occupy space.

If you need to change your margins or anything else when the BoundsMode changes, register for the VisibleBoundsChanged event:

ApplicationView.GetForCurrentView().VisibleBoundsChanged += OnVisibleBoundsChanged

You can read more in the official documentation.



来源:https://stackoverflow.com/questions/32822908/navigation-buttons-hiding-windows-phone-8-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!