Template relative layout

Ok, so to recreate my problem:

I create a new template, and check the “enable layout” checkbox.
I now place a shape inside, and choose this shape to have “relative layout” and check “maintain aspect ratio”.

When i use this template, and try to resize it in designer, the shape will not resize. Why?

How can i resize a shape inside a template and maintain it’s aspect ratio?

Maybe check the following thread:

Mark components in template to not resize

Hi Adam!
I have enabled layout, with no effect on this specific problem.

Do you have your controls wrapped in a container, besides the rootContainer?

At first i did, but for troubleshooting purposes i created a new template with only one shape inside.
Note that anchored layout works perfectly fine, it is only relative layout that will not function.

Also i don’t think that templates makes use of a “root container” like other windows do (at least it is not represented in the object tree).

Ah, sorry. You are correct about the missing rootContainer. My experience with templates has been minimal and I forgot. I’m afraid we exhausted my knowledge. Sorry, again.

Has anyone figured this out yet? I’m having the same issue where the relative layout option for my templates appears to be ignored no matter what I do.

So I think I figured out a workaround until someone figures out what is causing the template layout settings to seemingly be ignored. I just use anchored for everything. If I need an object in my template to scale when it is resized, I use an anchored setting on all sides.

If I don’t want something in my template to scale, I use an anchored setting only on the left and top sides.

Hi Jeff,

I have also tried this method, however my problem is that i in some cases need to keep the aspect ratio. This will not work when anchored to all sides.