UWP WrapPanel 更换? [英] UWP WrapPanel Replacement?

查看:29
本文介绍了UWP WrapPanel 更换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此 WPF 代码有替代品吗?

Is there a replacement for this WPF code?

<WrapPanel>
    <TextBlock Width="100" Height="20"/>
    <TextBlock Width="30" Height="50"/>
    <TextBlock Width="150" Height="70"/>                    
</WrapPanel>

如果没有的话,这真的很愚蠢......

This is really stupid if there is none...

更新:

我忘了说 WrapPanel 的宽度小于所有 TextBlocks 的总宽度.这意味着某些项目需要换行到第二行.

I forgot to mention that the width of the WrapPanel is smaller than the total width of all the TextBlocks combined. This means that some of the items need to wrap to a second row.

我认为这是大多数人使用 WrapPanel 的目的,但显然有些人将其用于 Horizo​​ntal StackPanel(在这种情况下,您应该将 StackPanel 的 Orientation 设置为 Horizo​​ntal...)

I thought that this is what most people used a WrapPanel for, but apparently some use it for a Horizontal StackPanel (In this case, you should set the StackPanel's Orientation to Horizontal...)

推荐答案

好吧,在我发布这篇文章 5 分钟后,我发现了 VariableSizedWrapGrid!它的确切替代品,只是名称不同(?!?).

Well well, 5 minutes after I posted this I found the VariableSizedWrapGrid! Its the exact replacement, just a different name (?!?).

这篇关于UWP WrapPanel 更换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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