问题描述
限时送ChatGPT账号..我想将我的单个 AppBarButton
与 Page.BottomBar
中的 CommandBar
上的右侧对齐?
I want to align my single AppBarButton
to the right on a CommandBar
in a Page.BottomBar
?
在设计中它在右侧显示 app bar button
但在模拟器中,按钮总是在中心?
In design it shows the app bar button
at the right side but in the emulator, the button is always at the center?
有没有办法在页面底部栏
中对齐AppBarButton
?
<Page.BottomAppBar>
<CommandBar HorizontalAlignment="Right" HorizontalContentAlignment="Right">
<CommandBar.PrimaryCommands>
<AppBarButton Margin="100,0,0,0" HorizontalAlignment="Right" HorizontalContentAlignment="Right" IsEnabled="True" Name="btnNext" Icon="Next" x:Uid="AppBarNext" Label="Next1"></AppBarButton>
</CommandBar.PrimaryCommands>
</CommandBar>
</Page.BottomAppBar>
推荐答案
您不能在 CommandBar 中居中按钮.话虽如此,如果您需要这种类型的控件,您只需切换到 AppBar 控件即可.相同的行为,只是更灵活.权衡是此控件不是通用的,不会在 Phone 中呈现.您需要为您的 Phone 平台头显示一个 CommandBar.
You cannot center buttons in a CommandBar. Having said that, if you need this type of control you simply need to switch to the AppBar control instead. Same behavior, just more flexibility. The trade-off is that this control is not universal and will not render in Phone. You would need to reveal a CommandBar for your Phone platform head.
这篇关于如何在命令栏中水平对齐 AppBarButton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论