| TableRow.LayoutParams ( width, height ) | ใช้สร้าง Object TableRow.LayoutParams |
|---|---|
| TableRow.LayoutParams ( ) | ใช้สร้าง Object TableRow.LayoutParams |
| TableRow.LayoutParams ( column ) | ใช้สร้าง Object TableRow.LayoutParams โดยมีการกำหนดจำนวนของ column เอาไว้ด้วย |
| column | ใช้คืนค่าจำนวนของ column ของ Object TableRow.LayoutParams |
method:TableRow.LayoutParams ( int width, int height )
return type:TableRow.LayoutParams
content:ใช้สร้าง Object TableRow.LayoutParams
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); TableLayout layout = new TableLayout ( this ); TableRow row = new TableRow ( this ); TableRow.LayoutParams params = new TableRow.LayoutParams ( 150, 30 ); row.addView ( new Button ( this ), params ); row.addView ( new Button ( this ), params ); layout.addView ( row ); layout.setStretchAllColumns ( true ); setContentView ( layout ); } }
method:TableRow.LayoutParams ( )
return type:TableRow.LayoutParams
content:ใช้สร้าง Object TableRow.LayoutParams
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); TableLayout layout = new TableLayout ( this ); TableRow row = new TableRow ( this ); TableRow.LayoutParams params = new TableRow.LayoutParams ( ); row.addView ( new Button ( this ), params ); row.addView ( new Button ( this ), params ); layout.addView ( row ); layout.setStretchAllColumns ( true ); setContentView ( layout ); } }
method:TableRow.LayoutParams ( int column )
return type:TableRow.LayoutParams
content:ใช้สร้าง Object TableRow.LayoutParams โดยมีการกำหนดจำนวนของ column เอาไว้ด้วย
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); TableLayout layout = new TableLayout ( this ); TableRow row = new TableRow ( this ); TableRow.LayoutParams params = new TableRow.LayoutParams ( 3 ); row.addView ( new Button ( this ), params ); row.addView ( new Button ( this ), params ); row.addView ( new Button ( this ), params ); layout.addView ( row ); layout.setStretchAllColumns ( true ); setContentView ( layout ); } }
method:column
return type:int
content:ใช้คืนค่าจำนวนของ column ของ Object TableRow.LayoutParams
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); TableLayout layout = new TableLayout ( this ); TableRow row = new TableRow ( this ); TableRow.LayoutParams params = new TableRow.LayoutParams ( 3 ); row.addView ( new Button ( this ), params ); row.addView ( new Button ( this ), params ); row.addView ( new Button ( this ), params ); layout.addView ( row ); layout.setStretchAllColumns ( true ); int num_column = params.column; setContentView ( layout ); } }