diff --git a/cocos/ui/UIListView.cpp b/cocos/ui/UIListView.cpp index 2f149b1c54..d127585303 100644 --- a/cocos/ui/UIListView.cpp +++ b/cocos/ui/UIListView.cpp @@ -385,14 +385,15 @@ void ListView::setDirection(Direction dir) { switch (dir) { + case Direction::NONE: + case Direction::BOTH: + break; case Direction::VERTICAL: setLayoutType(Type::VERTICAL); break; case Direction::HORIZONTAL: setLayoutType(Type::HORIZONTAL); break; - case Direction::BOTH: - return; default: return; break;