我在那里,
我正在尝试在列表视图单元格内使用滑动视图,但在Android上出现了意外行为。 该单元格不会滑动以在android上显示菜单。另外,单击单元格内的输入字段时会触发itemSelected事件。有关问题,请参阅下面的gif。
我正在使用以下代码
<ListView
ItemsSource="{Binding Products}"
IsVisible="{Binding Products.Count, Converter={StaticResource CountToBoolConverter}}"
SelectedItem="{Binding SelectedProduct}"
HasUnevenRows="True">
<ListView.ItemTemplate>
<DataTemplate>
<!-- <StackLayout> -->
<ViewCell>
<SwipeView>
<SwipeView.LeftItems>
<SwipeItems>
<!-- Item History button -->
<SwipeItem
Text="History"
BackgroundColor="{StaticResource ColorSecondary}"
Command="{Binding BindingContext.HistoryBtnCommand, Source={x:Reference ProductList}}"
CommandParameter="{Binding .}"
IsVisible="{Binding ShowProductHistory}" />
</SwipeItems>
</SwipeView.LeftItems>
<SwipeView.RightItems>
<SwipeItems>
<!-- Item History button -->
<SwipeItem
Text="Delete"
BackgroundColor="{StaticResource ColorDanger}"
Command="{Binding BindingContext.DeleteProductCommand, Source={x:Reference ProductList}}"
CommandParameter="{Binding .}"
IsVisible="{Binding ShowItemDeleteButton}" />
<SwipeItem
Text="Add"
BackgroundColor="{StaticResource ColorPrimary}"
Command="{Binding BindingContext.AddProductToProfileCommand, Source={x:Reference ProductList}}"
CommandParameter="{Binding .}"
IsVisible="{Binding ShowAddItemToProfileButton}" />
</SwipeItems>
</SwipeView.RightItems>
</SwipeView>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
[![iOS上的行为] [2]] [2]
Android上的行为
iOS上的行为 [2]:https://i.stack.imgur.com/p6XI4.gif
任何想法都会有所帮助。我需要单元格上的菜单。我尝试使用上下文菜单,但无法动态删除项目。