I use a TableLayout with two TableRows. One row contains three buttons. The other should take all remaining space for its output开发者_JAVA百科. How can this be accomplished? Either in XML or with the onMeasure method.
I'm not too familiar with using tables, but I know usually when you're laying out forms, if you want something like that, you lay out the things which are going to be normal size. Then you lay out the thing that is going to take up the remainder of the screen and set it's height property to "fill_parent". If you'll paste your code in I'd be happy to take a look at it and fix it for you. :-)
-Jared
Although its too late but still i would like to try this. Can u please try this and check whether this helps you
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
</TableRow>
</TableLayout>
</LinearLayout>
精彩评论