如何查找Listview是否以xamarin形式向上或向下滚动?

时间:2017-12-29 07:14:18

标签: xamarin.forms

当listview向上滚动并再次显示该视图时,我需要隐藏一些视图,当列表视图向下滚动时。 我用了

  private void ScheduleServiceList_ItemAppearing(object sender, Xamarin.Forms.ItemVisibilityEventArgs e)
        {           
            var currentItem = e.Item as VehicleService;
            double listviewheight = ScheduleServiceListView.Height;
            if (viewModel.VehicleServiceList[0].Id == currentItem.Id)
            {
                SearchEntryLayout.IsVisible = true;
                HeadingGrid.Margin = new Thickness(0, -70, 0, 0);
            }


        }

1 个答案:

答案 0 :(得分:0)

怎么样:

var listView = new ListView(ListViewCachingStrategy.RecycleElement)
{
    ....
    ItemTemplate = new DataTemplate(() =>
    {
        return new MyListViewCellView(new List<int> {  ... /* ids to disable or other objects */ });
    })
};