Windows Phone运行时pathicon运行时与设计时

时间:2014-08-12 06:39:05

标签: winrt-xaml windows-phone-8.1

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

在设计时(Blend和VS2013)中,按钮看起来完全符合我的预期,但在运行时,路径会延伸,因此它会填充按钮的圆圈。

设计时和运行时之间的区别是一个已知问题,是否有一个解决方法,以便我的按钮看起来应该如何看待运行时?

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

设计时间:designtime http://i62.tinypic.com/iqhbnt.jpg

运行时:runtime http://i58.tinypic.com/33lmruh.jpg

按钮的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>

1 个答案:

答案 0 :(得分:1)

我没有使用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>