WPF:如何使路径的大小与其父级的大小一致
假设在混合中我使用钢笔工具,然后创建一个封闭的形状。
然后我想让这个形状的宽度(或高度)拉伸到其容器的尺寸。
换句话说
<Grid Width="500">
<Path Data="Bla Bla" Width="200">
</Grid>
,我怎样才能使路径的宽度与其父级一致。我试着走,
<Canvas Width="500">
<Path Data="Bla Bla" HorizontalAlignment="Stretch">
</Canvas>
但这行不通。它适用于矩形,但不适用于路径,那么我该如何使用路径呢?
Let's say in blend I take the pen tool and I just create a closed shape.
I'd like to then make this shape's width (or height) stretch to its container's dimensions.
So let's say I have
<Grid Width="500">
<Path Data="Bla Bla" Width="200">
</Grid>
In other words, how can I make the path's width conform to its parent. I try to just go
<Canvas Width="500">
<Path Data="Bla Bla" HorizontalAlignment="Stretch">
</Canvas>
but that doesn't work. it works with a rectangle but not with a path, so how can I do it with a path?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)