树视图:如何更改标题行的行高



我能够更改 ttk::treeview 正常行的行高

ttk::style configure MyStyle.Treeview -rowheight 25

但此命令不会更改标题行的行高。我该怎么做?

似乎确实有办法改变标题的高度。

您能做的最好的事情是创建自定义字体并配置树视图标题 来使用它。

"标题"是树视图标题样式的名称。

font create headingfont
font configure headingfont -size 13
ttk::style configure Heading -font headingfont

编辑:根据Oliver Scholl的回答,您可以使用:

ttk::style configure Heading -padding {0 20}

这会将顶部/底部填充设置为 20,将左/右填充设置为 0。

-padding 20 ; # left/top/bottom/right all the same
-padding {0 20} ; # left/right, top/bottom
-padding {0 20 0 20} ; # left, top, right, bottom

解决方案是

ttk::style configure Treeview.Heading -padding "0 0 0 0"

ttk::style configure Treeview.Heading -padding {0 0 0 0}

填充选项是一个顺序为 {左上右下}的列表。

最新更新