This commit is contained in:
2020-08-01 17:55:18 +08:00
parent 29a8a1dae3
commit 4435098171
160 changed files with 21247 additions and 2405 deletions

View File

@@ -50,6 +50,7 @@ namespace Coolape
oldScrollViewPos = _scrollView.transform.localPosition;
oldClipOffset = _scrollView.panel.clipOffset;
_scrollView.panel.cullWhileDragging = true;
_scrollView.panel.onClipMove = OnMove;
}
}
return _scrollView;
@@ -703,5 +704,25 @@ namespace Coolape
itemList.Insert (targetIndex, movedWidget);
}
}
protected virtual void OnMove(UIPanel panel)
{
if (scrollView == null) return;
bool restrictWithinPanel = false;
if (list == null || list.Count == 0)
{
restrictWithinPanel = true;
}
if (!restrictWithinPanel && firstVislable && int.Parse(head.name) == 0)
{
restrictWithinPanel = true;
}
if (!restrictWithinPanel && lastVisiable && int.Parse(tail.name) == list.Count - 1)
{
restrictWithinPanel = true;
}
scrollView.restrictWithinPanel = restrictWithinPanel;
}
}
}
}