我正在尝试将 gridViewColumn 分成两行。我使用 listView 的默认样式。将列标题分成两行没有问题,但似乎内容被放置在原始样式上,边框等隐藏在我自定义的 gridViewHeader 内容下。代码如下所示:
<GridViewColumnHeader>
<GridViewColumnHeader.Template>
<ControlTemplate>
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid ShowGridLines="False" VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="SomeHeaderText" HorizontalAlignment="Center"/>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="SubHeaderText1" Padding="5" HorizontalAlignment="Center" />
<TextBlock Grid.Column="1" Text="SubHeaderText1" Padding="5" HorizontalAlignment="Center" />
</Grid>
</Grid>
</Grid>
</ControlTemplate>
</GridViewColumnHeader.Template>
</GridViewColumnHeader>
任何人都知道如何像这个例子一样裁剪 GridViewHeader 并保持 GridViewHeader 的外观