refactor ListView, add do Layout

This commit is contained in:
andyque 2014-06-04 10:51:32 +08:00
parent 652c214374
commit c6cb3a56fb
3 changed files with 5 additions and 4 deletions

View File

@ -437,9 +437,10 @@ void ListView::refreshView()
updateInnerContainerSize(); updateInnerContainerSize();
} }
void ListView::sortAllChildren() void ListView::doLayout()
{ {
ScrollView::sortAllChildren(); Layout::doLayout();
if (_refreshViewDirty) if (_refreshViewDirty)
{ {
refreshView(); refreshView();

View File

@ -161,7 +161,8 @@ public:
float getItemsMargin()const; float getItemsMargin()const;
virtual void sortAllChildren() override; virtual void doLayout() override;
virtual void addChild(Node * child) override; virtual void addChild(Node * child) override;
virtual void addChild(Node * child, int zOrder) override; virtual void addChild(Node * child, int zOrder) override;
virtual void addChild(Node* child, int zOrder, int tag) override; virtual void addChild(Node* child, int zOrder, int tag) override;

View File

@ -1587,7 +1587,6 @@ void ScrollView::interceptTouchEvent(Widget::TouchEventType event, Widget *sende
case TouchEventType::CANCELED: case TouchEventType::CANCELED:
case TouchEventType::ENDED: case TouchEventType::ENDED:
handleReleaseLogic(touchPoint);
handleReleaseLogic(touchPoint); handleReleaseLogic(touchPoint);
break; break;
} }