如何设置WPF ListView的行高? [英] How to set WPF ListView row height?

查看:1022
本文介绍了如何设置WPF ListView的行高?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ListView显示一些文字记录。我需要增加行(触摸屏,所以我需要更厚的行上工作)的高度不增加字体大小。

I've got a listView displaying a few text records. I need to increase the height of rows (working on a touch screen so I need thicker rows) without increasing the font size.

这大概是pretty微不足道,但我不知道,不能在谷歌找到太多

This is probably pretty trivial but I have no clue and can't find much on google.

任何帮助AP preciated。

Any help appreciated.

推荐答案

您可以设置在 ListView中所有的 ListViewItems 的高度使用 ItemContainerStyle

<ListView>
    <ListView.ItemContainerStyle>
        <Style TargetType="ListViewItem">
            <Setter Property="Height" Value="50" />
        </Style>
    </ListView.ItemContainerStyle>
</ListView>

这篇关于如何设置WPF ListView的行高?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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