diff --git a/cocos/ui/UIListView.cpp b/cocos/ui/UIListView.cpp index b0391bbcb1..2fe21805b9 100644 --- a/cocos/ui/UIListView.cpp +++ b/cocos/ui/UIListView.cpp @@ -437,9 +437,10 @@ void ListView::refreshView() updateInnerContainerSize(); } -void ListView::sortAllChildren() +void ListView::doLayout() { - ScrollView::sortAllChildren(); + Layout::doLayout(); + if (_refreshViewDirty) { refreshView(); diff --git a/cocos/ui/UIListView.h b/cocos/ui/UIListView.h index d053bca7cc..077c6827fe 100644 --- a/cocos/ui/UIListView.h +++ b/cocos/ui/UIListView.h @@ -161,7 +161,8 @@ public: float getItemsMargin()const; - virtual void sortAllChildren() override; + virtual void doLayout() override; + virtual void addChild(Node * child) override; virtual void addChild(Node * child, int zOrder) override; virtual void addChild(Node* child, int zOrder, int tag) override; diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index 97ac197faf..842a62592a 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -1587,7 +1587,6 @@ void ScrollView::interceptTouchEvent(Widget::TouchEventType event, Widget *sende case TouchEventType::CANCELED: case TouchEventType::ENDED: - handleReleaseLogic(touchPoint); handleReleaseLogic(touchPoint); break; }