Changes

Jump to: navigation, search

An Android TableLayout and TableRow Tutorial

4 bytes removed, 15:28, 4 February 2014
no edit summary
Modify the properties of the views so that they display text that reads “Product ID” and “ID Not Assigned” respectively, making sure to create new string resources for each label. Change the ID of the right hand TextView to productID. This can be achieved either by right-clicking on the view in the visual layout and selecting the appropriate menu option, or by double clicking on the component and directly editing the appropriate XML elements in the activity_database.xml file.
Drag and drop another TextView EditText and a Plain Text EditText view onto the second TableRow. Change the text on the TextView to Product Name and the ID of the EditText object to productName. With the Text View object selected in the layout, locate the Input Type property in the Property panel and change the type to text.
Drag and drop another TextView and a Number Text EditText view onto the third TableRow. Change the text on the TextView to Product Quantity and the ID of the EditText object to productQuantity.
Finally, add a LinearLayout (Horizontal) to the parent LinearLayout view, positioned immediately below the TableLayout view. Drag and drop three Button objects onto the LinearLayout and create and assign string resources for each button that read “Add”, “Find” and “Delete” respectively.
With the Linear Layout view selected in the Outline panel, change right click and select the Gravity setting in the Properties panel to center_horizontal -> Center Horizontal menu option so that the buttons are centered within the display:

Navigation menu