My RelativeLayout
should look more less like this:
+----------------------------------------------+
| |
| |
|+----------------+ +----------------+|
|| |+--------+| ||
|| View 1 || View 2 || View 3 ||
|+----------------++--------++----------------+|
| |
| |
+----------------------------------------------+
and I achieve it perfectly when my relative layout has fixed height (for example 80dp). Unfortunately I need it to have android:layout_height="wrap_content"
with android:minHeight
set (for example to those 80dp). When I change my layout this way, android:layout_alignBaseline
seems not to be working for View2, and I get something similar to this:
+----------------------------------------------+
| |
| +--------+ |
|+----------------+| View 2 |+----------------+|
|| |+--------+| ||
|| View 1 | | View 3 ||
|+----------------+ +----------------+|
| |
| |
+----------------------------------------------+
And my xml looks like this:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="80dp" >
<TextView
android:id="@+id/View1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/View2"
android:gravity="center"
android:text="View1" />
<TextView
android:id="@+id/View2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/View1"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="View2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/View2"
android:gravity="center"
android:text="View3" />
</RelativeLayout>
Anyone got any idea why it doesn't work?