I have the following in xml. It is used in a relative layout:
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv1"/>
<TextView
android:id="@+id/tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv2" />
In code, if I remove the 2nd textview (tv2), I want to reposition tv3 below tv1. I wasn't able to find a way to do this with xml, so I want to do it programmatically. How can I do this? Thanks a lot!