-2

As I am new to android so I am confused in layout managers, which should I use for my project? Please help in understanding the layout managers. As my I want to create layout contains views in the form of table layout having two rows and two columns.

2 Answers 2

1

Try this great resouce. Tons of information out there,

If you don't like reading, there's even a youtube video that does exactly what you ask.

If you just want a copy-paste solution, try this. With some minor tweaking it should give you what you want :

<TableLayout
    android:id="@+id/tablelayout"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent">

    <TableRow>
        <TextView
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_weight="1"
            android:text="Name:" />

        <EditText
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:id="@+id/et_name"
            android:layout_weight="1" />
    </TableRow>

    <TableRow>
        <TextView
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_weight="1"
            android:text="URL:" />

        <EditText
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:id="@+id/et_url"
            android:layout_weight="1" />
    </TableRow>
</TableLayout>
2
  • this is not even close to an answer
    – Ben Weiss
    Jun 23, 2011 at 10:13
  • 1
    it was not a real question either.... It's clear that no effort was done to even remotely investigate this. A basic Google search will provide him with a lot more information. The second search result is a youtube video that explains in details what he needs to do.
    – ddewaele
    Jun 23, 2011 at 10:21
0

have a look at Common Layout Objects to get an overview of the various Layout types and how to use them.

Not the answer you're looking for? Browse other questions tagged or ask your own question.