使用Uniform或UniformToFill设置拉伸到StackPanel的路径 [英] Stretching Path to StackPanel using Uniform or UniformToFill setting

查看:434
本文介绍了使用Uniform或UniformToFill设置拉伸到StackPanel的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!我需要将自定义内容设置为如下形状:
Hello! I need to put custom content into shape like that:

推荐答案

hi MxKazan,

hi MxKazan,

代替伸展" =均匀".使其拉伸=填充"

instead of Stretch = "Uniform" make it Stretch = "Fill"

 


<StackPanel Orientation="Horizontal"
   SnapsToDevicePixels="True">
      <Path Fill="Red" Margin="0,0,0,0"
   Data="M 6 0 L 0 10 L 6 20 z"
   Stretch="Fill"/>
      <TextBlock FontSize="25"
    Background="Red">

        Text</TextBlock>
      <Path Fill="Red" Margin="0,0,0,0"
   Data="M 6 0 H 0 V 20 H 6 L 0 10 z"
   Stretch="Fill"/>
    </StackPanel>


这篇关于使用Uniform或UniformToFill设置拉伸到StackPanel的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆