upgrade
This commit is contained in:
@@ -70,8 +70,9 @@ namespace Coolape
|
||||
}
|
||||
if (panel != null) {
|
||||
oldClipOffset = panel.clipOffset;
|
||||
panel.cullWhileDragging = true;
|
||||
panel.onClipMove = OnMove;
|
||||
}
|
||||
panel.cullWhileDragging = true;
|
||||
}
|
||||
}
|
||||
return _scrollView;
|
||||
@@ -445,6 +446,10 @@ namespace Coolape
|
||||
|
||||
isCanCallOnEndList = true;
|
||||
isCanCallOnHeadList = true;
|
||||
if(list.Count == 0)
|
||||
{
|
||||
ExecuteOnShowHeadList();
|
||||
}
|
||||
} catch (System.Exception e) {
|
||||
Debug.LogError (e);
|
||||
}
|
||||
@@ -575,6 +580,27 @@ namespace Coolape
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// 从原顺序位置移动到指定位置
|
||||
void moveCellPos (UIWidget moved, UIWidget target, int newIdx, int targetIdx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user