【问题标题】:App Bar in Windows Phone Universal AppWindows Phone 通用应用中的应用栏
【发布时间】:2014-06-11 00:31:34
【问题描述】:

我试图在我的 Windows Phone 通用应用中添加应用栏。这是我在项目中编写的代码:

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

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

我也尝试过 TopAppBar。结果是一样的。有什么方法可以添加适用于 Windows Phone 和本地机器的 App Bar?

提前致谢。 :)

【问题讨论】:

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


    【解决方案1】:

    在 Windows Store App 中,BottomAppBarTopAppBar 默认隐藏。当您Right-Click your mouseSwipe from bottom or top edge on your screen 时。将出现 BottomAppBar 或 TopAppBar。

    你可以在Adding app bars (XAML) MSDN看到它

    【讨论】:

      【解决方案2】:

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

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

      【讨论】:

        猜你喜欢
        • 2014-08-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-05-25
        • 2015-03-08
        • 2013-08-24
        相关资源
        最近更新 更多