【发布时间】:2016-03-21 11:43:56
【问题描述】:
我有一个 Windows Phone 8.1 应用程序 (WinRT),我有一个可以重新排序图像的 gridview,它工作正常。
运行 Windows 10 的手机上的同一应用无法重新排序项目。
重新排序模式设置正确,图像有点像 WP8.1 上的浮动,但是当我放下物品时,没有任何变化。
这是一个已知的错误还是让它工作的解决方法?
我的代码如下:
<GridView x:Name="GridView"
VerticalAlignment="Top"
Margin="-3"
IsSwipeEnabled="True"
AllowDrop="True"
CanReorderItems="True"
ItemsSource="{Binding ImagesReordered}">
在代码中
private void EnableReorderMode()
{
this.IsReordering = true;
this.GridView.ReorderMode = ListViewReorderMode.Enabled;
}
编辑
刚刚尝试使用更简单的代码(仅 xaml):
<GridView AllowDrop="true"
CanReorderItems="true"
ReorderMode="Enabled">
<GridViewItem>
<Rectangle Width="80"
Height="80"
Fill="Red"
Margin="4" />
</GridViewItem>
<GridViewItem>
<Rectangle Width="80"
Height="80"
Fill="Yellow"
Margin="4" />
</GridViewItem>
<GridViewItem>
<Rectangle Width="80"
Height="80"
Fill="Green"
Margin="4" />
</GridViewItem>
</GridView>
在 WP 8.1 应用上,重新排序在 WP 8.1 上有效,但在 Windows 10 移动版上无效。 在 W10 uwp 上,重新排序在 Windows 10 上运行良好。
【问题讨论】:
标签: windows-phone-8.1 uwp windows-10-mobile