Problem with positioning elements in Column Layout
Solved
QML and Qt Quick
-
wrote on 7 May 2017, 21:33 last edited by Pyroxar 5 Jul 2017, 21:34
I have code:
Item { ColumnLayout { spacing: 0 anchors.fill: parent Rectangle{ Layout.alignment: Qt.AlignTop | Qt.AlignHCenter Layout.fillWidth: true Layout.preferredHeight: (Screen.height*5)/8 color: "#E91E63" } Label { Layout.alignment: Qt.AlignTop | Qt.AlignHCenter text: "Lorem ipsum dolor" font.pixelSize: 28 color: "black" font.bold: true } Label { Layout.alignment: Qt.AlignTop | Qt.AlignHCenter text: "Ut auctor sem nec elit dictum semper" font.pixelSize: 16 color: "black" } } }
I want that my Labels are under pink rectangle but then are at the bottom page.
I don't know why
http://imgur.com/a/xfqlB -
I have code:
Item { ColumnLayout { spacing: 0 anchors.fill: parent Rectangle{ Layout.alignment: Qt.AlignTop | Qt.AlignHCenter Layout.fillWidth: true Layout.preferredHeight: (Screen.height*5)/8 color: "#E91E63" } Label { Layout.alignment: Qt.AlignTop | Qt.AlignHCenter text: "Lorem ipsum dolor" font.pixelSize: 28 color: "black" font.bold: true } Label { Layout.alignment: Qt.AlignTop | Qt.AlignHCenter text: "Ut auctor sem nec elit dictum semper" font.pixelSize: 16 color: "black" } } }
I want that my Labels are under pink rectangle but then are at the bottom page.
I don't know why
http://imgur.com/a/xfqlB -
I have code:
Item { ColumnLayout { spacing: 0 anchors.fill: parent Rectangle{ Layout.alignment: Qt.AlignTop | Qt.AlignHCenter Layout.fillWidth: true Layout.preferredHeight: (Screen.height*5)/8 color: "#E91E63" } Label { Layout.alignment: Qt.AlignTop | Qt.AlignHCenter text: "Lorem ipsum dolor" font.pixelSize: 28 color: "black" font.bold: true } Label { Layout.alignment: Qt.AlignTop | Qt.AlignHCenter text: "Ut auctor sem nec elit dictum semper" font.pixelSize: 16 color: "black" } } }
I want that my Labels are under pink rectangle but then are at the bottom page.
I don't know why
http://imgur.com/a/xfqlBwrote on 8 May 2017, 07:58 last edited by@Pyroxar Or if the previous one gave what you wanted (the empty white space which increases when the window is made larger goes under the labels, not between the rectangle and the labels), you can try this:
ColumnLayout { spacing: 0 //anchors.fill: parent anchors.right: parent.right anchors.left: parent.left anchors.top: parent.top
1/3