虚拟列表(父)套普通列表(子)的渲染回调问题

        public static int GetVirtualListItemIndex(GList gList, GObject obj)
        {
            int childIndex = gList.GetChildIndex(obj);
            int itemIndex = gList.ChildIndexToItemIndex(childIndex);
            return itemIndex;
        }
有一个虚拟列表, 每一行都是一个包含了普通列表(3列)的component, 在普通列表的渲染回调调用上面的接口,
GetVirtualListItemIndex(gList, obj.parent.parent);
找到数据对象的索引, 在虚拟列表缓慢滚动时没有问题, 但是快速滚动时, 例如用鼠标滚轮滚动, 会导致这个方法返回了错误的索引, 请问是此方法有错误, 还是其他什么机制导致的
已邀请:

谷主

赞同来自:

不是很明白你这个函数的glist到底是哪个list。如果是虚拟列表,是不能在渲染函数里去getchildindex的。

要回复问题请先登录注册