通用应用程序 Windows Phone 方向 [英] Universal App Windows Phone Orientation

查看:27
本文介绍了通用应用程序 Windows Phone 方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我正在为 Windows Phone 和 Windows 应用商店开发通用应用程序.在那个应用程序中,我试图将应用程序的方向修复为横向.但是在 Windows Phone 8.1 的基于 WinRT 的应用程序中,我没有找到任何方向选项.

Recently I was developing a Universal app for both the Windows Phone and Windows Store. In that app, I was trying to fix the Orientation of the App to Landscape. But in WinRT based apps of Windows Phone 8.1, I failed to find any Orientation option.

在 Silverlight 应用程序中,我们可以根据需要修复方向.但是有没有办法修复通用应用中的横向模式?

In the Silverlight apps, we can fix the Orientations as we want. But is there any way to fix the Orientation to Landscape mode in the Universal Apps?

如果有人在这方面帮助我,那将非常有帮助.提前致谢.:)

It will be very helpful if someone help me in this regard. Thanks in advance. :)

推荐答案

在 WinRT 下你可以看看 DisplayInformation 类,您可能会在其中找到所需的一切.

Under WinRT you can have a look at DisplayInformation class, where you will find probably all you need.

您还可以在 Supported rotations 中的 Package.appxmanifest 文件中声明您支持的旋转.

You can also declare your supported rotations in Package.appxmanifest file in Supported rotations.

此处您可以下载一个包含三个页面的应用示例,每个页面包含方向不同.

Here you can download an example of an App with three Pages, each with different orientation.

这篇关于通用应用程序 Windows Phone 方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆