簡體   English   中英

Windows Phone中最小化的應用程序欄的高度是多少

[英]What is the Height of the Minimized Application Bar in Windows Phone

我很好奇在“迷你”模式下如何獲得Windows Phone應用程序欄的高度。 顯示常規圖標按鈕時,我已經看到了一些關於高度的資源,但是沒有顯示橢圓。

在代碼背后:

double appBarMiniSize = ApplicationBar.MiniSize; // 30.0

我會幫你自己解決這個問題。 創建一個測試應用程序並修改主頁以具有以下xaml

<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>

運行應用程序。 您會注意到高度將顯示在TextBlock中。 取該金額並將其從800中減去,您將得到答案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM