| | |
| | | LockVerticalTop,
|
| | | LockVerticalBottom,
|
| | | KeepHorizon,
|
| | | KeepVertical,
|
| | | KeepVertical2,
|
| | | KeepVertical, //在滚动视图内容更新或刷新时,保持当前位置不变 置顶显示
|
| | | KeepVertical2, //在滚动视图内容更新或刷新时,保持当前位置不变 置底显示
|
| | | }
|
| | | public class ScrollerController : MonoBehaviour, IEnhancedScrollerDelegate {
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // 获取总的Cell数目(含不显示的)
|
| | | public int GetNumberOfCells()
|
| | | public int GetCellTotalCount()
|
| | | {
|
| | | return _data.Count;
|
| | | }
|
| | |
| | | if (horizontal)
|
| | | {
|
| | |
|
| | | rect.sizeDelta = rect.sizeDelta.SetX(Math.Min(jiaMiddleWithMaxSize, (m_CellHeaderPrefab.height + m_Scorller.spacing) * _data.Count - m_Scorller.spacing));
|
| | | rect.sizeDelta = rect.sizeDelta.SetX(Math.Min(jiaMiddleWithMaxSize, (m_CellHeaderPrefab.height + m_Scorller.spacing) * _data.Count - m_Scorller.spacing +
|
| | | m_Scorller.padding.right + m_Scorller.padding.left));
|
| | | }
|
| | | else if (vertical)
|
| | | {
|
| | | rect.sizeDelta = rect.sizeDelta.SetY(Math.Min(jiaMiddleWithMaxSize, (m_CellHeaderPrefab.height + m_Scorller.spacing) * _data.Count - m_Scorller.spacing));
|
| | | rect.sizeDelta = rect.sizeDelta.SetY(Math.Min(jiaMiddleWithMaxSize, (m_CellHeaderPrefab.height + m_Scorller.spacing) * _data.Count - m_Scorller.spacing +
|
| | | m_Scorller.padding.top + m_Scorller.padding.bottom));
|
| | | }
|
| | | if (rect.sizeDelta.x < jiaMiddleWithMaxSize)
|
| | | {
|
| | |
| | | lastDataCnt = _data.Count;
|
| | | }
|
| | |
|
| | | //index 是按addcell的顺序,包含所有层级
|
| | | public void JumpIndex(int index)
|
| | | {
|
| | | if (!inited)
|