[UWP][XAML] ListView child item not using full width

后端 未结 2 1042
日久生厌
日久生厌 2021-01-06 03:30

I\'m trying to display a list of bound items. I\'ve customized the datatemplate to be a grid and I want the right column (that has a fixed width) to stick to the right side

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-06 03:36

    I was just attempting to get my ListView to stretch properly and found this answer. I'm using Visual Studio 2017 and working on a UWA (Universal Windows App) project.

    I'm altering the default Grid element which was added by the project template and I couldn't get the ListView to stretch when it was added as a grid row / column.

    I finally stumbled upon the XAML you can add directly to the ListView element:

    HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
    

    It works great as you can see:

提交回复
热议问题