AbsoluteLayout aligning and centering items


#1

Hi all I’m having a hard time figuring this out and I wondered if anyone could help.

I’m trying to create a likert/tree type of interaction (bit like the terrible diagram below :slight_smile: ) where the user will be able to select one of the nodes. I need to align each of the nodes to the tree and then have the whole thing centered on screen. I can align the nodes to the tree using an absolute layout but I can’t figure out how you would then center the layout itself.

Thanks for looking!

O--
   |
    --O
   |
O--
   |
    --O

    
    

#2

Why not use a gridlayout? That might be easier to use across different device screens


#3

Seems easier with GridLayout.

But if you pretend to use the AbsoluteLayout in order to achieve the so called tree, maybe get the PageHeight and PageWidth values and then you can define where it starts and where the tree ends.


#4

Thanks for the replies guys I ended up getting it working with absolute positioning.


#5

Be careful, with absolute positioning. If you run on another emulator with different screen sizes it will most likely end up being out of format, since emulators different on screen sizes and your predifing coordinates with absolute positioning.