Windows phone 7 Windows Phone中最小化的应用程序栏的高度是多少
我很好奇,在“迷你”模式下,如何获得Windows Phone应用程序条的高度。当显示常规图标按钮时,我已经看到了一些关于高度的参考资料,但没有一个只有省略号。我将帮助您自己解决这个问题。创建一个测试应用程序并修改主页,使其具有以下xamlWindows phone 7 Windows Phone中最小化的应用程序栏的高度是多少,windows-phone-7,windows-phone-8,Windows Phone 7,Windows Phone 8,我很好奇,在“迷你”模式下,如何获得Windows Phone应用程序条的高度。当显示常规图标按钮时,我已经看到了一些关于高度的参考资料,但没有一个只有省略号。我将帮助您自己解决这个问题。创建一个测试应用程序并修改主页,使其具有以下xaml <phone:PhoneApplicationPage x:Class="WinPhone8App.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presen
<phone:PhoneApplicationPage
x:Class="WinPhone8App.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"
shell:SystemTray.IsVisible="False">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<TextBlock Text="{Binding ActualHeight, ElementName=LayoutRoot}" />
</Grid>
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar Mode="Minimized">
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="test" />
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>
运行应用程序。您会注意到高度将显示在文本块中。把这个数字从800中减去,你就会得到你的答案。在codebehind中:
double appBarMiniSize = ApplicationBar.MiniSize; // 30.0
好的,我一定会测试一下。不过我很好奇,Windows Phone 8中的新设备尺寸如本文所述,确定720p和1080p分辨率的最小化应用程序条的高度需要减去853,对吗?这实际上取决于他们(Microsoft)如何实现这一点。当前页面高度始终为“800”,然后按比例放大以适应屏幕。因此,对于分辨率为1280x768的920设备,它仍然表示整个页面的实际高度为800。我希望这会有所改变,因为我想在更大的设备上放更多的内容,而不是仅仅是更大的相同数量的内容。谢谢,30px正是我在检查屏幕大小时使用的,但是有一种硬编码的检查方式很好。非常感谢!