I have 4 buttons A,B,C,D on a RelativeLayout.
The button C is sometimes visible, sometimes not – depending on some condition which is set expliticly everytime before the layout appears.
If all buttons are visible I like to position the buttons like this:
A
B
C
D
Otherwise if C is not visible like this
A
B
D
Since I use android:layout_below="@+id/buttonX" to position the buttons I do not know what to do with the conditional C and D buttons.
What would be the best way to do this?
Although I don’t like nesting views, a simple solution would be to include your bottom two buttons in a LinearLayout
Ex.
That way you can set the LinearLayout below B and it wouldn’t matter if C or D was missing