From dd534a8d4ef3b95efb45f64b8e05d21a9876556a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Mon, 1 Mar 2021 20:15:28 +0800 Subject: [PATCH] fix layout error --- doric-Qt/doric/resources/hlayout.qml | 4 ++++ doric-Qt/doric/resources/vlayout.qml | 4 ++++ doric-demo/src/SimpleDemo.ts | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doric-Qt/doric/resources/hlayout.qml b/doric-Qt/doric/resources/hlayout.qml index 239eeba0..a39f3418 100644 --- a/doric-Qt/doric/resources/hlayout.qml +++ b/doric-Qt/doric/resources/hlayout.qml @@ -3,4 +3,8 @@ import QtQuick.Controls 2.5 Flex { flexDirection: "row" + flexWrap: "wrap" + justifyContent: "flexStart" + alignItems: "flexStart" + alignContent: "stretch" } diff --git a/doric-Qt/doric/resources/vlayout.qml b/doric-Qt/doric/resources/vlayout.qml index 1fab265d..7f0f6e68 100644 --- a/doric-Qt/doric/resources/vlayout.qml +++ b/doric-Qt/doric/resources/vlayout.qml @@ -3,5 +3,9 @@ import QtQuick.Controls 2.5 Flex { flexDirection: "column" + flexWrap: "wrap" + justifyContent: "flexStart" + alignItems: "flexStart" + alignContent: "stretch" } diff --git a/doric-demo/src/SimpleDemo.ts b/doric-demo/src/SimpleDemo.ts index 563a24e0..a4057888 100644 --- a/doric-demo/src/SimpleDemo.ts +++ b/doric-demo/src/SimpleDemo.ts @@ -3,7 +3,7 @@ import { Group, Panel, text, gravity, Color, LayoutSpec, vlayout, hlayout, scrol @Entry class LayoutDemo extends Panel { build(rootView: Group) { - hlayout([ + vlayout([ stack([], { width: 100, height: 100,