/// <summary> /// 当前页最后一个item的真是数据id,通过FindItemByDataIdx找到对应的item /// </summary> /// <returns></returns> public int GetCurViewLastDataID() { int itemMax = 0; ///itempool中最后一个可见的 UIWidgetContainer theTemp = m_Table; if (m_bGrid) { theTemp = m_Grid; } if (theTemp == null) { return(-1); } InfiniteItemBehavior[] behs = theTemp.GetComponentsInChildren <InfiniteItemBehavior>(); if (behs.Length <= 0) { return(-1); } foreach (InfiniteItemBehavior bb in behs) { if (bb.itemDataIndex > itemMax) { itemMax = bb.itemDataIndex; } } return(itemMax); }
/// <summary> /// 当前页第一个item的真是数据id,通过FindItemByDataIdx找到对应的item /// </summary> /// <returns></returns> public int GetCurViewFirstDataID() { int firstDataIndex = int.MaxValue; UIWidgetContainer theTemp = m_Table; if (m_bGrid) { theTemp = m_Grid; } if (theTemp == null) { return(-1); } InfiniteItemBehavior[] behs = theTemp.GetComponentsInChildren <InfiniteItemBehavior>(); if (behs.Length == 0) { return(-1); } foreach (InfiniteItemBehavior bb in behs) { if (bb.itemDataIndex < firstDataIndex) { firstDataIndex = bb.itemDataIndex; } } return(firstDataIndex); }