简体   繁体   English

在Xamarin Forms中的Listview OnDisappear的顶部获取项目的索引号

[英]Get index number of item at the top of a Listview OnDisappear in Xamarin Forms

Is it possible to get the index number of a listview cell that is on the top of the ListView when OnDisappear? 当OnDisappear出现时,是否可以获得列表视图顶部的列表视图单元格的索引号?

I am trying to store the position of the listview when a user tabs to clicks a modal, and restore it later OnAppear. 我试图在用户使用Tab键单击模式时存储listview的位置,然后在OnAppear上将其还原。

I would use ItemAppearing event 我将使用ItemAppearing事件

var listView = new ListView { ... };

listView.ItemAppearing += async (sender, e) =>
{
    // get index of e.Item + add count of items available at visual
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM