How to create android layout [closed]
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 questionAs 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.
精彩评论