FileDocCategorySizeDatePackage
TableLayout8.javaAPI DocGoogle Android v1.5 Example2212Sun Nov 11 13:01:04 GMT 2007com.google.android.samples.view

TableLayout8

public class TableLayout8 extends android.app.Activity

Fields Summary
private boolean
mStretch
Constructors Summary
Methods Summary
private voidappendRow(android.widget.TableLayout table)

        TableRow row = new TableRow(this);

        TextView label = new TextView(this);
        label.setText(R.string.table_layout_8_quit);
        label.setPadding(3, 3, 3, 3);

        TextView shortcut = new TextView(this);
        shortcut.setText(R.string.table_layout_8_ctrlq);
        shortcut.setPadding(3, 3, 3, 3);
        shortcut.setAlignment(Layout.Alignment.ALIGN_OPPOSITE);

        row.addView(label, new TableRow.LayoutParams(1));
        row.addView(shortcut, new TableRow.LayoutParams());

        table.addView(row, new TableLayout.LayoutParams());
    
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        setContentView(R.layout.table_layout_8);

        final TableLayout table = (TableLayout) findViewById(R.id.menu);
        Button button = (Button) findViewById(R.id.toggle);
        button.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v) {
                mStretch = !mStretch;
                table.setColumnStretchable(1, mStretch);
            }
        });

        mStretch = table.isColumnStretchable(1);

        appendRow(table);