Best code examples for Android TableLayout class (android.widget.TableLayout)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android TableLayout class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android TableLayout examples from Open Source projects
This code example shows how to use the following methods: isColumnCollapsed, setColumnCollapsed
25:	layout.setColumnCollapsed(1, !layout.isColumnCollapsed(1)); 
26:	if (layout.isColumnCollapsed(1)) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isColumnCollapsed, setColumnCollapsed
26:	layout.setColumnCollapsed(1, !layout.isColumnCollapsed(1)); 
27:	if (layout.isColumnCollapsed(1)) { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isColumnCollapsed, setColumnCollapsed
23:	layout.setColumnCollapsed(1, !layout.isColumnCollapsed(1)); 
24:	if (layout.isColumnCollapsed(1)) { 
Full Snippet Info
5
CodeRank
Examples using Android TableLayout addView method:
This code example shows how to use the following methods: addView, setColumnShrinkable, setColumnStretchable, setTag
94:	TableLayout layout = new TableLayout(ctxt); 
95:	layout.setColumnStretchable(0, true); 
96:	layout.setColumnShrinkable(0, true); 
-
123:	layout.addView(tableRow); 
-
125:	wrap=new ViewWrapper(layout); 
-
127:	layout.setTag(wrap); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setGravity, setOrientation, addView, setLayoutParams
104:	Container = new TableLayout(this.getBaseContext()); 
105:	Container.setOrientation(TableLayout.VERTICAL); 
-
109:	Container.setLayoutParams(tl); 
110:	Container.setGravity(Gravity.CENTER_HORIZONTAL); 
-
119:	Container.addView(TipsContainer, lp); 
-
126:	Container.addView(StageGellery, tl); 
-
134:	Container.addView(StageText, tl); 
-
139:	Root.addView(Container, rl); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setOrientation, addView, setShrinkAllColumns, setStretchAllColumns, setLayoutParams
32:	layout = new TableLayout(this); 
-
35:	layout.setOrientation(TableLayout.VERTICAL); 
36:	layout.setShrinkAllColumns(false); 
37:	layout.setStretchAllColumns(true); 
-
39:	layout.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.FILL_PARENT)); 
-
156:	layout.addView(round); 
157:	layout.addView(usernames); 
158:	layout.addView(rd1row); 
159:	layout.addView(rd2row); 
160:	layout.addView(rd3row); 
161:	layout.addView(brrow); 
162:	layout.addView(totalrow); 
-
164:	layout.addView(buttonrow); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setColumnShrinkable
42:	table.setColumnShrinkable(0, mShrink); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setColumnStretchable
45:	table.setColumnStretchable(1, mStretch); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addView, setColumnStretchable, setLayoutParams
26:	TableLayout tabela = new TableLayout(this); 
27:	tabela.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); 
-
29:	tabela.setColumnStretchable(1, true); 
-
64:	tabela.addView(linha1); 
65:	tabela.addView(linha2); 
66:	tabela.addView(linha3); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addView, setColumnStretchable, setLayoutParams
24:	TableLayout tableLayout = new TableLayout(this); 
25:	tableLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 
-
27:	tableLayout.setColumnStretchable(1, true); 
-
64:	tableLayout.addView(row1); 
65:	tableLayout.addView(row2); 
66:	tableLayout.addView(row3); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addView, setStretchAllColumns, setLayoutParams
16:	TableLayout tableLayout = new TableLayout(this); 
17:	tableLayout.setLayoutParams(new TableLayout.LayoutParams( 
-
21:	tableLayout.setStretchAllColumns(true); 
-
61:	tableLayout.addView(tableRow1); 
62:	tableLayout.addView(tableRow2); 
63:	tableLayout.addView(tableRow3); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setColumnCollapsed
53:	table.setColumnCollapsed(0, mCheckmarksCollapsed); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setColumnCollapsed
46:	table.setColumnCollapsed(2, mShortcutsCollapsed); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setColumnCollapsed
46:	table.setColumnCollapsed(2, mShortcutsCollapsed); 
Full Snippet Info
5
CodeRank
Examples using Android TableLayout requestLayout method:
This code example shows how to use the following methods: requestLayout, removeViewInLayout
60:	tableLayout.removeViewInLayout(mTableRow); 
-
62:	tableLayout.requestLayout(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: removeAllViews, requestLayout
57:	tuitions.removeAllViews(); 
-
70:	tuitions.requestLayout(); 
Full Snippet Info
5
CodeRank
Examples for other Android TableLayout methods:
Related Android TableLayout Questions & Answers:
TableLayout Class Overview
A layout that arranges its children into rows and columns. A TableLayout consists of a number of TableRow objects, each defining a row (actually, you can have other children, which will be explained below). TableLayout containers do not display border lines for their rows, columns, or cells. Each row has zero or more cells; each cell can hold one View object. The table has as many columns as the row with the most cells. A table can leave cells empty. Cells can span columns, as they can in HTML.The width of a column is defined by the row with the widest cell in that column. However, a TableLayout can specify certain columns as shrinkable or stretchable by calling setColumnShrinkable() or setColumnStretchable(). If marked as shrinkable, the column width can be shrunk to fit the table into its parent object. If marked as stretchable, it can expand in width to fit any extra space. The total width of the table is defined by its parent container. It is important to remember that a column can be both shrinkable and stretchable. In such a situation, the column will change its size to always use up the available space, but never more. Finally, you can hide a column by calling setColumnCollapsed().The children of a TableLayout cannot specify the layout_width attribute. Width is always MATCH_PARENT. However, the layout_height attribute can be defined by a child; default value is WRAP_CONTENT. If the child is a TableRow, then the height is always WRAP_CONTENT. Cells must be added to a row in increasing column order, both in code and XML. Column numbers are zero-based. If you don't specify a column number for a child cell, it will autoincrement to the next available column. If you skip a column number, it will be considered an empty cell in that row. See the TableLayout examples in ApiDemos for examples of creating tables in XML.Although the typical child of a TableLayout is a TableRow, you can actually use any View subclass as a direct child of TableLayout. The View will be...
Methods
  • requestLayout
    Call this when something has changed which has invalidated the layout of this view.