Droiddraw tutorial 2: table layout

Source: Internet
Author: User

Droiddraw tutorial 2: table layout

  • Step 0

This tutorial describes how to create a simple input and tablelayout layout from droiddraw. This tutorial assumes that you have downloaded and installed the android SDK. This tutorial also assumes that you are quite familiar with GUI Programming Concepts and Java programming languages.

  • Step 1

Start the droiddraw user interface designer.

  • Step 2

Select relativelayout as the root layout.

  • Step 3

Select the "layouts" tab

  • Step 4

Drag a tablelayout object from the layouts panel to the center of the screen.

  • Step 5

Double-click "tablelayout" to modify its attributes. Change its width to fill_parent"

  • Step 6

Drag the three tablerow objects from the layouts panel to the tablelayout object. When you drag and drop a tablerow object, you should select tablelayout from the pop-up menu.

  • Step 7

Drag and Drop a textview in each tablerow:

  • Step 8

Double-click each textview to modify its properties. Modify the displayed text as follows:

  • Step 9

Drag and Drop An edittext in each tablerow to the right of the existing text.

  • Step 10

Select tablelayout and modify the "stretchable column" (Extensible column) attribute value to 1. This will expand all the edittext widgets to fill the table.

  • Step 11

Edit the attributes of each edittext and set the text attribute ""

  • Step 12

Drag a button to the blank area in the lower right corner of tablelayout. It should be out of tablelayout and right aligned with it.

  • Step 13

Modify the properties of the button. Set the text to "OK"

 

 

  • Step 14

Click "generate" to generate the. xml file.

  • Step 15

Create a new Android project in eclipse

  • Step 16

Replace the Res/layouts/mian. xml file with the XML generated in step 1.

  • Step 17

Run your new project and you should see your GUI in Android. It should be like this:

  • Complete XML file
  1. Android: Id = "@ + ID/widget49"
  2. Android: layout_width = "fill_parent"
  3. Android: layout_height = "fill_parent"
  4. Xmlns: Android = "http://schemas.android.com/apk/res/android">
  5. Android: Id = "@ + ID/widget54"
  6. Android: layout_height = "160px"
  7. Androidrientation = "vertical"
  8. Android: stretchcolumns = "1"
  9. Android: layout_alignparenttop = "true"
  10. Android: layout_centerhorizontal = "true" Android: layout_width = "fill_parent">
  11. Android: Id = "@ + ID/widget55"
  12. Android: layout_width = "fill_parent"
  13. Android: layout_height = "wrap_content"
  14. Androidrientation = "horizontal">
  15. Android: Id = "@ + ID/widget58"
  16. Android: layout_width = "wrap_content"
  17. Android: layout_height = "wrap_content"
  18. Android: text = "name">
  19. Android: Id = "@ + ID/widget61"
  20. Android: layout_width = "wrap_content"
  21. Android: layout_height = "wrap_content"
  22. Android: textsize = "18sp">
  23. Android: Id = "@ + ID/widget56"
  24. Android: layout_width = "fill_parent"
  25. Android: layout_height = "wrap_content"
  26. Androidrientation = "horizontal">
  27. Android: Id = "@ + ID/widget59"
  28. Android: layout_width = "wrap_content"
  29. Android: layout_height = "wrap_content"
  30. Android: text = "hone">
  31. Android: Id = "@ + ID/widget62"
  32. Android: layout_width = "wrap_content"
  33. Android: layout_height = "wrap_content"
  34. Android: textsize = "18sp">
  35. Android: Id = "@ + ID/widget57"
  36. Android: layout_width = "fill_parent"
  37. Android: layout_height = "wrap_content"
  38. Androidrientation = "horizontal">
  39. Android: Id = "@ + ID/widget60"
  40. Android: layout_width = "wrap_content"
  41. Android: layout_height = "wrap_content"
  42. Android: text = "E-mail">
  43. Android: Id = "@ + ID/widget63"
  44. Android: layout_width = "wrap_content"
  45. Android: layout_height = "wrap_content"
  46. Android: textsize = "18sp">
  47. Android: Id = "@ + ID/widget64"
  48. Android: layout_width = "wrap_content"
  49. Android: layout_height = "wrap_content"
  50. Android: text = "button"
  51. Android: layout_below = "@ + ID/widget54"
  52. Android: layout_alignright = "@ + ID/widget54">

  • Result

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.