Android TableRow with text under image,multi line TextViews

1.6k views Asked by At

I need to add following format rows for Android TableView. Can someone please help me to do this?enter image description here

Thanks.

2

There are 2 answers

0
Emil On BEST ANSWER

Try this layout.

<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/TableRow1"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="20dp"
    android:orientation="horizontal" >

<LinearLayout
    android:id="@+id/first"
    android:layout_width="0dp"
    android:layout_height="100dp"
    android:layout_weight="1"
    android:gravity="center"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/enaiv" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView" />
</LinearLayout>

<LinearLayout
    android:id="@+id/LinearLayout01"
    android:layout_width="0dp"
    android:layout_height="100dp"
    android:layout_weight="1"
    android:gravity="center"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/TextView01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView" />
</LinearLayout>

<LinearLayout
    android:id="@+id/LinearLayout02"
    android:layout_width="0dp"
    android:layout_height="100dp"
    android:layout_weight="1"
    android:gravity="center"
    android:orientation="vertical" >

    <TextView
        android:layout_gravity="center"
        android:id="@+id/TextView03"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView" />
</LinearLayout>

</TableRow>
0
Anil Meenugu On

Android TableLayout going to be arranged groups of views into rows and columns. You will use the element to build a row in the table. Each row has zero or more cells; each cell can hold one View object

http://www.mkyong.com/android/android-tablelayout-example/

http://developerlife.com/tutorials/?p=307