I have a layout like the following:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".SettingsActivity" >
<TableRow
...
</TableRow>
<TableRow
...
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Temperature:" />
<SeekBar
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
In the third TableRow
the TextView
and the SeekBar
share the space equally. I want the TextView
to be only as wide is the text inside it, and the SeekBar
should fill the rest of the space. I have tried fiddling with gravity, width, and weights. What is the best way to get this behavior?