tags:

views:

110

answers:

1

Hi,

How can I layout 2 TextViews and a SeekBar on the same line in my layout xml file? I know

But how can i specify TextView (one on the right, one on the left) to use only the width it needs to display the string in the TextView while SeekBar will use up the rest of the line?

And i don't know the text vale of each TextView in the beginning and these TextView can change value in my application.

Thank you for any suggestion.

A: 

The easiest way would probably be to use a TableLayout. Something like:

<TableLayout
 android:layout_width="fill_parent"
 android:layout_height="wrap_content" 
 android:stretchColumns="1">
 <TableRow>
  <TextView
   android:layout_width ="wrap_content" 
   android:layout_height="wrap_content"
   android:textSize     ="whatever" />
  <SeekBar
   android:layout_width ="fill_parent" 
   android:layout_height="wrap_content" />
  <TextView
   android:layout_width ="wrap_content" 
   android:layout_height="wrap_content"
   android:textSize     ="whatever" />
 </TableRow>
</TableLayout>
fiXedd