开发者

How can I layout 2 TextViews (1 on left, 1 on right) and a SeekBar on the same line

How can I layout 2 TextViews and a SeekBar o开发者_JS百科n 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.


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜