【发布时间】:2016-06-10 11:08:00
【问题描述】:
我正在做 windows 通用平台 (UWP) 的项目。在这个项目中,我有一个关于底部 Appbar 的问题。
我设计了一个底部 Appbar 并添加了一个 7 Appbar Button.which 在桌面和表格视图中正确显示,但在移动视图中它没有正确显示。我捕获了移动和桌面视图的底部 Appbar 照片。 所以请提供移动视图的解决方案,我如何管理所有 7 个 appbar 按钮? 如何减小 appbar 按钮的大小?因此它将在移动视图中正确显示。
代码:
<Page.BottomAppBar>
<AppBar x:Name="applicationbar" Background="#FFE45427">
<StackPanel x:Name="bottombar" Orientation="Horizontal" HorizontalAlignment="Center">
<AppBarButton Label="HOME" x:Name="appbarhome" Click="appbarhome_Click">
<AppBarButton.Icon>
<BitmapIcon UriSource="Images/DashboardImages/product-default-small.png" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Label="Sales" x:Name="appbarsales" Click="appbarsales_Click">
<AppBarButton.Icon>
<BitmapIcon UriSource="Images/DashboardImages/menu_sales.png"/>
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Label="Product" x:Name="appbarproduct" Click="appbarproduct_Click">
<AppBarButton.Icon>
<BitmapIcon UriSource="Images/DashboardImages/menu_product.png" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Label="POS" x:Name="appbarpos" Click="appbarpos_Click">
<AppBarButton.Icon>
<BitmapIcon UriSource="Images/DashboardImages/menu_pos.png"/>
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Label="Customer" x:Name="customer" Click="customer_Click">
<AppBarButton.Icon>
<BitmapIcon UriSource="Images/DashboardImages/menu_customers.png"/>
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Label="About US" x:Name="aboutUs" Click="aboutUs_Click">
<AppBarButton.Icon>
<BitmapIcon UriSource="Images/DashboardImages/menu_aboutus.png"/>
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Label="Logout" x:Name="mobile_logout_commandbar" Click="mobile_logout_commandbar_Click">
<AppBarButton.Icon>
<BitmapIcon UriSource="Images/DashboardImages/menu_logout.png"/>
</AppBarButton.Icon>
</AppBarButton>
</StackPanel>
</AppBar>
</Page.BottomAppBar>
图片:
【问题讨论】:
-
您应该对视图大小的变化做出反应,当它变窄时,将一些项目放在SecondaryCommands 菜单中。减小按钮的宽度会使它们更难点击,这不是解决此问题的方法。
标签: xaml win-universal-app windows-10 uwp