-
November 26th, 2022, 21:45 #1
Troubles with relative/current positioning
I'm back. I need to build a form with some fields that can be hidden.
So I decided to use relative. What you see here are not all the fields of the form, but they are the first ones. Beyond there will be those to hide and other additional fields.
I have a label with a stringfield next to it.
Under these another label and another stringfield. Everything works fine except for the last strigfield.
Code:First label <anchored to="leftanchor"> <top parent="leftanchor" anchor="bottom" relation="relative" /> <left /> </anchored> First stringfield <anchored to="leftanchor" width="90"> <top parent="leftanchor" anchor="top" relation="current"/> <left parent="leftanchor" anchor="left" relation="relative" offset="70" /> </anchored> Second label <anchored to="leftanchor" > <top parent="leftanchor" anchor="bottom" relation="relative" /> <left /> </anchored> Second stringfield <anchored to="leftanchor" width="420"> <top parent="leftanchor" anchor="bottom" relation="current"/> <right parent="rightanchor" relation="absolute" offset="0" /> </anchored>
rightanchor is used only for right alignment. I tried without it and the problem is still there, so I guess it doesn't affect the misbehaviour.
What am I doing wrong or what do I not understand?
-
November 27th, 2022, 00:43 #2
Instead of anchoring all of them off of the left anchor, you might try anchoring the stringfields off of the labels. Or instead of using the leftanchor as the parent, use the labels as the left parent.
EDIT: Reading more on this in the wiki, I believe the anchor you would want is anchor="left" relation="current" for all of the stringfields. This should tie them onto the latest label.Last edited by DCrumb; November 27th, 2022 at 00:56.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks