Windows Phone Universal App中的App Bar

时间:2014-06-11 00:31:35

标签: winrt-xaml windows-8.1 windows-phone-8.1 win-universal-app

我试图在我的Windows Phone Universal应用程序中添加App Bar。这是我在项目中编写的代码:

<Page.BottomAppBar>
    <CommandBar>
        <AppBarButton Icon="Accept" Label="AppBarButton"/>
        <AppBarButton Icon="Cancel" Label="AppBarButton"/>
    </CommandBar>
</Page.BottomAppBar>

应用栏在我的Windows Phone和Windows Phone模拟器中正常显示。但是我遇到的问题是当我将Windows版本部署到本地计算机和模拟器时,没有应用程序栏可见。

我也尝试过TopAppBar。结果是一样的。有没有办法添加适用于Windows Phone和本地计算机的App Bar?

提前致谢。 :)

2 个答案:

答案 0 :(得分:4)

在Windows应用商店应用中,默认情况下会隐藏 BottomAppBar TopAppBar 。当您Right-Click your mouseSwipe from bottom or top edge on your screen时。将出现BottomAppBar或TopAppBar。

您可以在Adding app bars (XAML) MSDN

中看到它

答案 1 :(得分:2)

您可以将IsOpen属性设置为True,以在页面加载时显示应用栏。

<Page.BottomAppBar>
    <CommandBar IsOpen="True">
       <AppBarButton Icon="Accept" Label="AppBarButton"/>
       <AppBarButton Icon="Cancel" Label="AppBarButton"/>
   </CommandBar>
</Page.BottomAppBar>
相关问题