【问题标题】:WP 7.1 app shows thich Black header while running in WP8 emulatorWP 7.1 应用程序在 WP8 模拟器中运行时显示黑色标题
【发布时间】:2023-03-17 05:15:01
【问题描述】:

我在 WP7.1 中开发了一个 windows phone 应用程序,在 WP8.0 中运行时,它显示了一个黑色的粗边框, 这是我的代码

<phone:PhoneApplicationPage 
    x:Class="MapTestApp7.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" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Blue">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"></Grid>
    </Grid>

</phone:PhoneApplicationPage>

这里是输出图像的链接: https://docs.google.com/file/d/0By0Y-Dca1cKjWUJ3emtPZHVDbVk/edit?usp=sharing

请帮我移除顶部边框。

【问题讨论】:

    标签: windows windows-phone-7 windows-phone-8 windows-phone-7.1 windows-phone-8-emulator


    【解决方案1】:

    不幸的是,对于在 WP8 720p 设备上运行的 WP7,无法移除该边框。 如果你不想要边框,你需要将你的 WP7 项目转换为 WP8。

    解释:

    WP7 应用被限制在一个 480*800 的容器中,当在 768*1280 或 720*1280 的 Windows Phone 8 设备上运行时,该容器会向上扩展。

    在 768*1280 设备 (WXGA) 上,缩放比例为 1.6x => 无边框。

    在 720*1280 设备 (720p) 上,缩放比例为 1.5 倍,顶部有 80 像素黑色边框(缩放后为 53 像素)。

    【讨论】:

    • 我已将我的解决方案升级到 WP8.0,但仍然可以看到黑色顶部。
    • 在设计模式还是在模拟器中?
    • 在 Visual Studio 2012 中,我们可以选择将解决方案升级到 WP8.0
    • 是的,但是在 720p 模拟器上或仅在设计器视图上运行应用程序时,您仍然有黑色边框吗?
    • 在设计器视图中我没有任何边框,但是在模拟器 720P 中运行时,它来了。
    【解决方案2】:

    将 d:DesignHeight="768" 更改为 d:DesignHeight="800"

    这应该可以解决问题。

    兄弟,

    【讨论】:

    • :在 Emulator 720P 中,仍然可以看到那厚实的黑色顶部。
    • 在这种情况下,您必须创建一个单独的 WP8 应用程序。 Wp7 应用在 720p 上的缩放比例不同(如下 Olivier 所述)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-09
    • 1970-01-01
    • 2015-01-08
    相关资源
    最近更新 更多