I have the following views in a table row:
<TableRow>
<RelativeLayout>
<RelativeLayout
android:id="@+id/back_layer"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<LinearLayout
android:id="@+id/front_layer"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
</TableRow>
back_layer and front_layer overlap each other. Both should have the same size and fill the parent view. back_layer must be under front_layer thus back_layer is rendered before front_layer.
The problem is that front_layer has an arbitrary height. Because of the rendering order, there is no way for the back_layer to know the eventual height of the front_layer when the back_layer is rendered. front_layer has the same height as the parent. I am having a hard time making back_layer fill its parent height.
I am sure I can add back_layer after front_layer is added. Where would be the right place to do it (I tried to do it in the adapter and it does not work)? And how should I do it? I will need the reference of the table, and change the back_layer of every row in the table. Is that realistic?