开发者

How to create android layout [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. 开发者_如何学运维

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 7 years ago.

Improve this question

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.


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>


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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜