Use a LinearLayout
and weightSum
. I modified your code (see below). Note the added weightSum
in the LinearLayout
, the changed widths of the TextViews
and the layout_weights
of the TextViews
:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:id="@+id/sourceLanguage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left|center_vertical"
android:text="test1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#FF3366"
android:textIsSelectable="true" />
<TextView
android:id="@+id/targetLanguage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left|center_vertical"
android:text="test2"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#993366"
android:textIsSelectable="true" />
</LinearLayout>