ListViewItem Horizontal Strechting UWP 10

前端 未结 1 1601
伪装坚强ぢ
伪装坚强ぢ 2021-01-27 01:23

I want to horizontally stretch a ListView in UWP 10. I also set the HorizontalContentAlignment to Stretch. It kinda works, but its not exa

相关标签:
1条回答
  • 2021-01-27 02:00

    You need to modify ItemContainerStyle's padding and margin:

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

    You also have defined Grid's padding to 8, what will result in aqua background around your item.

    0 讨论(0)
提交回复
热议问题