如何使uniformgrid垂直 [英] how to make uniformgrid vertically

查看:624
本文介绍了如何使uniformgrid垂直的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 UniformGrid 键,它使项目水平显示。有没有一种方法,使之垂直显示?

I'm using UniformGrid and it's making the items display horizontally. Is there a way to make it display vertically?

<ListView.ItemsPanel>
    <ItemsPanelTemplate>
        <UniformGrid Columns="3" />
    </ItemsPanelTemplate>
</ListView.ItemsPanel>

任何帮助将大大AP preciated。

Any help would be greatly appreciated.

推荐答案

在WPF UniformGrid 布局仅是水平的,例如:

The WPF UniformGrid layout is horizontal only, e.g.:

1 2 3
4 5 6
7 8 9

也许你可以使用 WrapPanel 来代替,只是设置 ItemHeight ItemWidth 到你想要的网格大小和设置方向 Orientation.Vertical

Perhaps you could use a WrapPanel instead and just set the ItemHeight and ItemWidth to your desired grid size and set the Orientation to Orientation.Vertical.

或者你可以创建一个派生 UniformGrid 来处理方向,有一个很好的例子的on MSDN

Or you could create a derived UniformGrid to handle Orientation, there is a good example on MSDN.

这人会显示:

1 4 7
2 5 8
3 6 9

这是什么意思?

这篇关于如何使uniformgrid垂直的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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