如何在命令栏中水平对齐 AppBarButton

编程入门 行业动态 更新时间:2024-10-27 06:23:14
本文介绍了如何在命令栏中水平对齐 AppBarButton的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我想将我的单个 AppBarButtonPage.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:关键词]

本文发布于:2023-04-25 13:28:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1117771.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:栏中   命令   水平   如何在   AppBarButton

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!