2013-03-16 67 views
0

我与ListViewItem的一个probleme,我定义样式类似这样的:ListViewItem的不拉伸

<ListView.ItemContainerStyle> 
    <Style TargetType="ListViewItem"> 
      <Setter Property="Margin" Value="0" /> 
      <Setter Property="Padding" Value="0" /> 
      <Setter Property="HorizontalContentAlignment" Value="Stretch" /> 
      <Setter Property="Background" Value="Red"></Setter> 
    </Style> 
</ListView.ItemContainerStyle> 

,其结果是:

SnappedImage http://img692.imageshack.us/img692/4579/snappedviewstretchl.png

我该怎么做才能伸展ListViewItems ?

非常感谢

回答

0

的问题是不是ItemContainerStyle但我投入的ListView控件。

边框doest不适合ListViewItem,解决问题我将宽度设置为280像素(320 - 20 * 2,Snapped ViewState)