Using FrameLayout, how can I position child elements vertically to begin with? I am choosing Framelayout because, eventually, I want to move one child over another, but am unable to position them linearly to begin with.
Begin
End
Using FrameLayout, how can I position child elements vertically to begin with? I am choosing Framelayout because, eventually, I want to move one child over another, but am unable to position them linearly to begin with.
Begin
End
If you know the height of the top view you can set the layout_marginTop of the bottom view to be equal to that value.
Otherwise you could switch to a RelativeLayout and use layout_below to position the bottom view relative to the top view.
Using FrameLayout, how can I position child elements vertically to begin with?
by vertically i am assuming | child 1 | child 2 |
. For this you can use a linear layout with android:orientation="vertical"
. Enclose the two child layouts within this layout and use android:layout_weight
in the child and android:weightsum
in the enclosing layout.
if you want to keep that horizontal set orientation to horizontal.