Code example for TableLayout

Methods: setShrinkAllColumnssetStretchAllColumns, setLayoutParams

0
     *  
     * @return The button grid portion of this <code>ControlPadView</code>. 
     */ 
    private View buildButtonGrid(final Layout layout)
    { 
        TableLayout buttonGrid = new TableLayout(getContext());
        buttonGrid.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
        buttonGrid.setShrinkAllColumns(true);
        buttonGrid.setStretchAllColumns(true);
 
        for (int rowIndex = 0; rowIndex < layout.getButtonGridHeight(); rowIndex++)
        { 
            TableRow buttonGridRow = new TableRow(getContext());
            buttonGridRow.setLayoutParams(new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, 0, 1.0f));
 
            for (int columnIndex = 0; columnIndex < layout.getButtonGridWidth(); columnIndex++)
            { 
                Key key = layout.getButtonGridKey(getContext(), rowIndex, columnIndex);
                if (key != null)
                { 
                    if (key.getImageResourceId() == -1)