【发布时间】:2012-05-08 12:14:44
【问题描述】:
有人知道从 GridViewItem 中删除所有填充的方法吗?我正在使用非常小的物品(虽然不是太小,我在下图中夸大了),并且在选择物品时有一些填充物,这使得它变得非常糟糕,我想把它拿出来。这就是我的意思:
图片的代码是这样的:
<GridView Margin="120,80,0,0"
SelectionMode="Multiple">
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel
Orientation="Horizontal" />
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</GridView.ItemContainerStyle>
<Rectangle Height="10" Width="10" Fill="Red" />
<Rectangle Height="10" Width="10" Fill="Orange" />
<Rectangle Height="10" Width="10" Fill="Blue" />
<Rectangle Height="10" Width="10" Fill="Green" />
<Rectangle Height="10" Width="10" Fill="Yellow" />
</GridView>
提前致谢!
【问题讨论】:
标签: xaml gridview windows-8 windows-runtime winrt-xaml