积极答复者
gridview 显示一行两列,并垂直滚动

问题
答案
-
Hi,
你可以使用WrapGrid 来实现这样的布局,请看下面的例子:
<ListView Height="320" Width="260"> <ListView.ItemsPanel> <ItemsPanelTemplate> <WrapGrid Orientation="Horizontal" MaximumRowsOrColumns="2"/> </ItemsPanelTemplate> </ListView.ItemsPanel> <Rectangle Height="100" Width="100" Fill="Blue" /> <Rectangle Height="100" Width="100" Fill="Red" /> <Rectangle Height="100" Width="100" Fill="Yellow" /> <Rectangle Height="100" Width="100" Fill="Green" /> <Rectangle Height="100" Width="100" Fill="Gray" /> <Rectangle Height="100" Width="100" Fill="LightBlue" /> <Rectangle Height="100" Width="100" Fill="Pink" /> <Rectangle Height="100" Width="100" Fill="YellowGreen" /> </ListView>
这样您可以得到一行两列的布局,也可以使Listview里面的content实现垂直滚动的效果。
祝您好运!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- 已标记为答案 HamGuy15 2014年1月15日 4:13
全部回复
-
Hi,
你可以使用WrapGrid 来实现这样的布局,请看下面的例子:
<ListView Height="320" Width="260"> <ListView.ItemsPanel> <ItemsPanelTemplate> <WrapGrid Orientation="Horizontal" MaximumRowsOrColumns="2"/> </ItemsPanelTemplate> </ListView.ItemsPanel> <Rectangle Height="100" Width="100" Fill="Blue" /> <Rectangle Height="100" Width="100" Fill="Red" /> <Rectangle Height="100" Width="100" Fill="Yellow" /> <Rectangle Height="100" Width="100" Fill="Green" /> <Rectangle Height="100" Width="100" Fill="Gray" /> <Rectangle Height="100" Width="100" Fill="LightBlue" /> <Rectangle Height="100" Width="100" Fill="Pink" /> <Rectangle Height="100" Width="100" Fill="YellowGreen" /> </ListView>
这样您可以得到一行两列的布局,也可以使Listview里面的content实现垂直滚动的效果。
祝您好运!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- 已标记为答案 HamGuy15 2014年1月15日 4:13
-
Hi,
你可以使用WrapGrid 来实现这样的布局,请看下面的例子:
<ListView Height="320" Width="260"> <ListView.ItemsPanel> <ItemsPanelTemplate> <WrapGrid Orientation="Horizontal" MaximumRowsOrColumns="2"/> </ItemsPanelTemplate> </ListView.ItemsPanel> <Rectangle Height="100" Width="100" Fill="Blue" /> <Rectangle Height="100" Width="100" Fill="Red" /> <Rectangle Height="100" Width="100" Fill="Yellow" /> <Rectangle Height="100" Width="100" Fill="Green" /> <Rectangle Height="100" Width="100" Fill="Gray" /> <Rectangle Height="100" Width="100" Fill="LightBlue" /> <Rectangle Height="100" Width="100" Fill="Pink" /> <Rectangle Height="100" Width="100" Fill="YellowGreen" /> </ListView>
这样您可以得到一行两列的布局,也可以使Listview里面的content实现垂直滚动的效果。
祝您好运!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.HamGuy | Windows Phone 8