【问题标题】:UWP is there any way to set Horisontal Align = Center for Icon in the AppBarButton?UWP有没有办法在AppBarButton中设置Horizo​​ntal Align = Center for Icon?
【发布时间】:2019-04-26 09:25:38
【问题描述】:

我有:

<CommandBar ..>
..
<CommandBar.PrimaryCommands>
<AppBarButton Name="btnStop" ToolTipService.ToolTip="btnStop">
                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE73B;" Foreground="Red"/>
                </AppBarButton>
</CommandBar.PrimaryCommands>
</CommandBar>

看起来是一样的:

有什么方法可以让图标居中对齐吗? 如果我在“实时资源管理器属性”中设置 本地 -> 图标 -> 讲义视觉 -> 偏移 = 它看起来更好。如何在代码中做同样的事情?

【问题讨论】:

  • 您的标记对我有用 - 它是水平对齐的。也许您有一个全局样式干扰了 appbarbutton,它正在为您向左移动?
  • @Mark W,非常感谢您的回答。我会尝试在我自己的代码中找到问题。

标签: xaml button uwp commandbar


【解决方案1】:

如果没有标签,应该是 LabelPosition="Collapsed"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-30
    相关资源
    最近更新 更多