FileDocCategorySizeDatePackage
TableLayout8.javaAPI DocAndroid 1.5 API2246Wed May 06 22:41:08 BST 2009com.example.android.apis.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.setGravity(Gravity.RIGHT | Gravity.TOP);

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

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

        super.onCreate(savedInstanceState);

        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);