Как сделать так, чтобы ImageView и TextView были одинаковой высоты

В моем макете есть ImageView(iv) и TextView(tv). Я хочу расположить tv справа от iv. Высота телевизора такая же, как у iv. Гравитация телевизора установлена как CENTER_VERTICAL.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/RelativeLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >


    <ImageView
        android:id="@+id/iv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"/>


    <TextView
        android:id="@+id/tv"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_toRightOf="@+id/iv"
        android:text="TextView" android:gravity="center_vertical"/>

</RelativeLayout>

Как достичь цели?

7
задан brian 3 January 2012 в 08:57
поделиться