Is it possible to do something like this where TV2 is relative to TV1, where TV1 and TV2 are within different branches of the layout?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:id="@+id/RV1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/TV01"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:text="test text" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/RV2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/RV1" >
<TextView
android:id="@+id/TV02"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_toRightOf="@+id/TV01" <--------- this references TV01 within the top RelativeView !!!
android:text="other text" />
</RelativeLayout>
</RelativeLayout>
in this example the statement android:layout_toRightOf="@+id/TV01" does not seem to work, since TV01 is within another RealtiveLayout branch than TV02.
Is there a way to somehow make references like this?
Many thanks!
No, you cannot use RelativeLayout positioning like that. However:
RV1andRV2or
RV2to the right ofRV1