How to stack components in Layout?

I want to have an image and a label underneath it, with a GridLayout.

The Embedded component is there, but when I try to drag a Label component on it, it says “Could not drop that item there.”

How would I stack those two components? Do I need to use another layout than GridLayout? If so, how can I retain the 2x4 grid without using GridLayout?

Hi,

Could you show a sketch or an image with the required layout ?

Hi,

Here you go:

-Mingle

You can simply add VBox to your GridLayout and then add Embedded and Label to this VBox.
GridLayout does not support multiple components in a cell so you have to use one of container components: VBoxLayout/HBoxLayout/GridLayout/etc.

Example XML:


<grid spacing="true">
    <columns count="2"/>
    <rows>
        <row>
            <vbox spacing="true" width="AUTO">
                <embedded type="BROWSER" src="url://http://cuba-platform.com" width="200px" height="200px"/>
                <label value="Label"/>
            </vbox>

            <label value="Empty"/>
        </row>
        <row>
            <label value="Empty"/>

            <label value="Empty"/>
        </row>
    </rows>
</grid>