EndlessScrollView中当前所选Item在列表中居中显示

    //currentSelectIndex 当前选中Item在整个EndlessList中的Index
    //CountDisplayed    Endless所能显示的Item个数
    //CorrectedValue      PlaneCountDisplayed的一半,取整
    //startIndex          Endless要显示的第一个Item的Index

    int startIndex = Mathf.Max(currentSelectIndex - CorrectedValue, 0);   
        if (dataList.Count >= CountDisplayed                                                                                                                                                                                                                                                                  
            && currentSelectIndex >= dataList.Count - CorrectedValue)
            startIndex = dataList.Count - CountDisplayed;
    Scrollview.SetDataList(dataList, startIndex, currentSelectIndex);
点赞