【问题标题】:Enable orientation in Windows Phone 8.0 application在 Windows Phone 8.0 应用程序中启用方向
【发布时间】:2014-11-27 14:56:47
【问题描述】:

我是 Windows Phone 应用程序开发的新手。我正在为 Windows 8.0 开发应用程序。我在项目中找不到文件 [Package.appxmanifest]。

应用程序中是否有打开方向的设置?因为当我旋转手机时,我的控件在肖像模式下保持不变。

谁能指导我一下?

【问题讨论】:

    标签: windows-phone-8


    【解决方案1】:

    Package.appxmanifest 是 WP8.1 运行时的东西。对于 WP 8.0,它是 AppManifestWMAppManifest。您可以在项目解决方案下的属性下找到它。


    至于方向,单击您的 MainPage.xaml 并选择您的 <phone:PhoneApplicationPage> 标记。在 Common 下,您可以更改方向。

    这是处理方向更改的快速入门指南:Quickstart: Screen orientation for Windows Phone 8

    【讨论】:

      【解决方案2】:

      在您的设计器页面中,将有一个名为 SupportedOrientations 的属性。您可以将其更改为纵向、横向或纵向或横向。

      在开发过程中,如果要更改方向,请使用 Orientation 属性。

      <phone:PhoneApplicationPage
      x:Class="TemplateSwitcher.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
      xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    
      mc:Ignorable="d"
      FontFamily="{StaticResource PhoneFontFamilyNormal}"
      FontSize="{StaticResource PhoneFontSizeNormal}"
      Foreground="{StaticResource PhoneForegroundBrush}"
      SupportedOrientations="Portrait" Orientation="Portrait"
      shell:SystemTray.IsVisible="True">
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-21
        • 2016-03-06
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多