What i want to achieve is a something like i have illustrated below.

When you press a button the content shows upp, and the other buttons change location according to the content size.
Did that make any sence? 
I have tried to find tutorials on this with no luck, so if anyone know about one, Great! 