【问题标题】:ListViewItem does not StretchListViewItem 不拉伸
【发布时间】:2019-09-01 11:21:37
【问题描述】:

我的 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>

结果是:

如何拉伸 ListViewItems ?

非常感谢

【问题讨论】:

    标签: xaml windows-runtime


    【解决方案1】:

    问题不是 ItemContainerStyle 而是我放入 ListView 的控件。

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

    【讨论】:

      猜你喜欢
      • 2016-10-27
      • 1970-01-01
      • 1970-01-01
      • 2017-08-22
      • 1970-01-01
      • 2012-07-25
      • 2011-07-02
      • 1970-01-01
      • 2022-01-18
      相关资源
      最近更新 更多