none
ListView如果如何实现多列宽度自适应 RRS feed

  • 问题

  • <ListView HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" IsItemClickEnabled="False" Background="AliceBlue"> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsWrapGrid Orientation="Horizontal" HorizontalAlignment="Stretch" MaximumRowsOrColumns="2"/> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListViewItem Background="Aqua" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"> <TextBlock Text="1111"/> </ListViewItem> <ListViewItem Background="Aquamarine" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"> <TextBlock Text="2222"/> </ListViewItem> <ListViewItem> <TextBlock Text="3333"/> </ListViewItem> <ListViewItem> <TextBlock Text="44444"/> </ListViewItem>

    </ListView>

    现在listviewitem的宽度为 ListViewItem里面的内容宽度

    要怎样才能实现多列平分一整行,即宽度就像Grid的*,而不是ListViewItem里面的内容宽度



    2016年4月9日 23:38