【发布时间】:2014-06-03 05:42:45
【问题描述】:
当我在 8.1 1080 模拟器上运行我的 Windows Phone 8 应用程序时,它的所有页面上都有一个黑色的下边距(有趣的是,当我在设计视图中查看这些页面中的任何一个时,它实际上并没有出现)。
最初,我认为这可能是我自定义布局的 PhoneApplicationPage 的结果。因此,我决定创建一个新的 PhoneApplicationPage,而不做任何更改,即 Visual Studio 自动生成的 Portrait PhoneApplicationPage。这是它的 xaml:
<phone:PhoneApplicationPage
x:Class="App.Views._1080p"
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"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Red">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,17,0,0">
<TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock 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>
我所做的唯一更改是为 Grid 添加一个红色背景属性,以便更好地突出问题。
我没有对代码隐藏进行任何更改。
不幸的是,问题仍然存在:
如果我将应用栏添加到 xaml,问题会变得更加严重。
这是应用栏的 xaml:
<!-- APP BAR -->
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar
x:Name="appBar"
IsVisible="True"
IsMenuEnabled="True"
Mode="Default"
Opacity="1" >
<!-- APP BAR ICONS -->
<shell:ApplicationBarIconButton
IconUri="a"
Text="Search"/>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
这就是它的样子:
知道发生了什么吗?我需要改变什么来解决这个问题?任何指导将不胜感激。我应该补充说,在 1080p 设备上运行应用程序时确实会发生问题(即不仅仅是模拟器上的问题)。
【问题讨论】:
-
那是 Windows Phone 8.1 Silverlight 应用程序还是 Windows Phone 8.0 Silverlight 应用程序?无论哪种方式,这都不会显示在我的 1080p 设备上。
-
一个 Windows 8.0 Silverlight 应用程序。
-
我的意思是 Windows Phone 8.0 Silverlight 应用程序。
-
模拟器是你运行的8.1吗?可能是模拟器为新的屏幕按钮做了冗余?
-
是的,但正如我提到的,这也发生在 8.1 1080p 设备上(而不仅仅是在 8.1 模拟器上)。
标签: xaml layout windows-phone-8 windows-phone windows-phone-8.1