windows - 如何更好地处理 CommandBar 中的长项目名称
问题描述
有没有比默认更好的方法来处理CommandBar
具有长文本的项目。字符长度因语言而异,因此有时可能无法看到项目文本是什么,因为CommandBar
扩展时会发生变化。
XAML(法语)
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<CommandBar Grid.Row="0">
<CommandBar.Content>
<Button
Style="{StaticResource NavigationBackButtonNormalStyle}"
Name="BackButton"
VerticalAlignment="Top"
Click="Back_Click"/>
</CommandBar.Content>
<AppBarButton Icon="Mail" Label="Information sur le produit"/>
<AppBarButton Icon="Mail" Label="Avis sur les produits"/>
<AppBarButton Icon="Mail" Label="Informations de contact"/>
</CommandBar>
<Frame Name="MyFrame" Grid.Row="1"/>
</Grid>
XAML(英文)
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<CommandBar Grid.Row="0">
<CommandBar.Content>
<Button
Style="{StaticResource NavigationBackButtonNormalStyle}"
Name="BackButton"
VerticalAlignment="Top"
Click="Back_Click"/>
</CommandBar.Content>
<AppBarButton Icon="Mail" Label="Product information"/>
<AppBarButton Icon="Mail" Label="Product reviews"/>
<AppBarButton Icon="Mail" Label="Contact information"/>
</CommandBar>
<Frame Name="MyFrame" Grid.Row="1"/>
</Grid>
英语(折叠)
英语(扩展)
法语(折叠)
法语(扩展)
解决方案
有没有比默认更好的方法来处理具有长文本的 CommandBar 项目。
为 制作太长的内容并不是更好的做法CommandBar
,如果您确实想制作较长的内容,可以将 设置DefaultLabelPosition
为正确。
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<CommandBar Grid.Row="0" DefaultLabelPosition="Right">
<CommandBar.Content>
<Button
Style="{StaticResource NavigationBackButtonNormalStyle}"
Name="BackButton"
VerticalAlignment="Top"
Click="Back_Click"/>
</CommandBar.Content>
<AppBarButton Icon="Mail" Label="Information sur le produit" />
<AppBarButton Icon="Mail" Label="Avis sur les produits"/>
<AppBarButton Icon="Mail" Label="Informations de contact"/>
</CommandBar>
<Frame Name="MyFrame" Grid.Row="1"/>
</Grid>
推荐阅读
- matlab - 从图像中提取 CMY 颜色分量
- javascript - 我想显示一个页面的数据并使用 chrome 扩展显示到网站的另一个页面中?
- powerbi - 显示正确的目标线
- wget - wget 递归下载所有子目录中的特定文件类型
- scala - Spark:以指定的日期格式读取 csv
- flutter - Flutter 应用程序上的 flutter_dotenv 出现空安全错误
- php - 购买多件商品,但只扣入钱包一次
- python - 使用引用自身的类型进行键入
- python - 如何在 WD mycloud 中运行 python 代码?
- java - 数据流管道将整个 GCS 纯文本文件内容、路径和创建时间加载到 PubSub json 格式的消息中