gpt4 book ai didi

winrt-xaml - Windows Phone 运行时 pathicon 运行时与设计时

转载 作者:行者123 更新时间:2023-12-02 03:33:29 24 4
gpt4 key购买 nike

我正在开发 WP8.1 运行时应用程序(使用通用应用程序模板)。我创建了一个带有切换按钮的应用栏。按钮图标是 PathIcon。

在设计时(包括 Blend 和 VS2013),按钮看起来与我期望的完全一样,但在运行时路径会延伸,因此它会填满按钮的圆圈。

设计时和运行时之间的这种差异是否是一个已知问题?是否有解决方法可以让我的按钮看起来像它在运行时应该看起来的样子?

它在 Blend 中的每个分辨率下看起来都不错,所以这不是缩放问题

设计时间:designtime

运行时间:runtime

按钮的 XAML:

<Page.BottomAppBar>
<CommandBar>
<AppBarToggleButton Label="HQ">
<AppBarToggleButton.Icon>
<PathIcon HorizontalAlignment="Left"
VerticalAlignment="Top"
Data="M21.0007,6.25 C6.3752,1.125 5.25043,16.6091 5.62518,19.5 C5.9215,21.7858 6.25018,10.75 16.0005,12.875 C19.8337,13.7104 24.1247,19.3755 20.3747,23.0006 C20.1689,23.1995 18.7133,17.0212 13.6254,19.5002 C8.75026,21.8755 13.0958,28.4331 12.8234,28.4006 C5.88184,27.5722 0.5,21.6646 0.5,14.5 C0.5,6.76801 6.76801,0.5 14.5,0.5 C19.153,0.5 23.0847,2.9988 25.2497,6.50016 C25.7361,7.28663 25.9271,7.98672 26.2501,8.87522 C26.75,10.2503 22.9202,6.92261 21.0007,6.25 z" />
</AppBarToggleButton.Icon>
</AppBarToggleButton>
</CommandBar>

最佳答案

我没有使用 PathIcon 进行测试,但您可以使用 Path 就好了:

<CommandBar>
<AppBarToggleButton Label="HQ">
<Path VerticalAlignment="Center" HorizontalAlignment="Center"
Fill="White" Stroke="White"
Data="M21.0007,6.25 C6.3752,1.125 5.25043,16.6091 5.62518,19.5 C5.9215,21.7858 6.25018,10.75 16.0005,12.875 C19.8337,13.7104 24.1247,19.3755 20.3747,23.0006 C20.1689,23.1995 18.7133,17.0212 13.6254,19.5002 C8.75026,21.8755 13.0958,28.4331 12.8234,28.4006 C5.88184,27.5722 0.5,21.6646 0.5,14.5 C0.5,6.76801 6.76801,0.5 14.5,0.5 C19.153,0.5 23.0847,2.9988 25.2497,6.50016 C25.7361,7.28663 25.9271,7.98672 26.2501,8.87522 C26.75,10.2503 22.9202,6.92261 21.0007,6.25 z" />
</AppBarToggleButton>
</CommandBar>

关于winrt-xaml - Windows Phone 运行时 pathicon 运行时与设计时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25257725/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com