当我ListBox使用水平项目创建时,例如:
<DockPanel>
<ListBox>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBoxItem>
<Button Content="Hello" />
</ListBoxItem>
<ListBoxItem>
<Button Content="Hello" />
</ListBoxItem>
</ListBox>
</DockPanel>
Run Code Online (Sandbox Code Playgroud)
我在列表中的按钮之间有小间隙,如下图中的箭头所示:

我怎么能摆脱这些差距呢?我需要ListBox彼此相邻的物品.我试图改变ItemTemplate的ListBox,但它并没有帮助.