I'm having a problem with the TableLayout
.
First, take a look at the screenshot:
As you can see, there is a pretty big space in the middle of the TableLayout
.
I don't know how to reduce the space in the middle, so that the TableRows
will have more Width to cover.
And also, I want to reduce the space between a TableRow
and the one below it.
I'm adding the views to the TableLayout
programmatically.
Also, I've already set the 'layout_weight
' of the content of the TableRow
to 1f:
TableRow tr = (TableRow) new TableRow(mTableLayout.getContext());
TableRow.LayoutParams params = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);
NormalCard card = new NormalCard();
card.setLayoutParams(new TableRow.LayoutParams(0, 740, 1f));
tr.addView(card);
mTableLayout.addView(tr, params);
XML declaration of the TableLayout
:
<TableLayout
android:id="@+id/tableLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:shrinkColumns="*"
android:stretchColumns="*"
android:dividerPadding="0dp"
android:showDividers="none"
android:divider="@null">
</TableLayout>
How do I reduce the space in the middle of the TableLayout
.
And also, How to reduce the space between a TableRow
and the one below it.
Thank you upfront.