cancel
Showing results for 
Search instead for 
Did you mean: 

Feature request: constraint based layout

Tuoman
Senior II

This might be in your to-do list in the future already, but I would appreciate this type of feature a lot.

If I want to have dynamic text size fields at the moment, I must write relative positioning for the elements manually.

(aka. element1.setY(element2.getY() + element2.getHeight() + ELEMENT1_2_OFFSET))

Constraint layout features would enable to set position to elements based on other elements.

4 REPLIES 4
Martin KJELDSEN
Chief III

So you're saying you would like a sort of "anchor" for some elements on your view?

Yes, one element must be anchor, then other elements are positioned in relationship to it, based on its dynamic size and location.

This is common practise in Android UI edition for example:

https://www.youtube.com/watch?v=Ngz5cgLC7m4

I think this can be implemented in parts, and does not need to be full-blown android style editor.

For example simple dropdown selection like

"Relative positon to element: SELECT ELEMENT HERE"

"XY Offset: ENTER OFFSET HERE"

Would be sufficient. Then touchgfx just does the element1.setY(element2.getY() + element2.getHeight() + ELEMENT1_2_OFFSET)) under the hood.

This is useful when the element has dynamic size (e.g. text field), and you want to place object below, right or left of the element regardless of its size.

Martin Stig STISSING
ST Employee

@Tuoman​ Thanks a lot for suggesting this.

Would you mind reposting your feature request to the Idea Zone. under the TouchGFX category?

This enables other interested parties in chipping in and voting for your request.

Thanks in advance.

You got it! Posted.