在主工程文件(xxx.cpp , xxx为你的项目名)中,
函数名为void xxx::SetWindow(CoreWindow^ window)
相关代码片如下:
<pre name="code" class="cpp">void ImpasseForLife::SetWindow(CoreWindow^ window)
{
// Specify the orientation of your application here
// The choices are DisplayOrientations::Portrait or DisplayOrientations::Landscape or DisplayOrientations::LandscapeFlipped
DisplayProperties::AutoRotationPreferences = DisplayOrientations::Portrait;
//...
}
其中修改
DisplayOrientations::
之后的就行了,默认是
Landscape,为横屏,Portrait是竖屏,第三个应该是横屏的另一个方向