I am having an issue in my application. I have a TableLayout, with a set space and I want the rows to evenly take up the full space. This works with the TableRows I inserted in the XML, however, if I want to add a TableRow later on, it takes up the minimal height.
Here I add the TableRow to my TableLayout:
tl = findViewById(R.id.tabelle);
View view = LayoutInflater.from(this).inflate(R.layout.tablerow, null);
tl.addView(view);
And this is the XML of the TableRow:
<?xml version="1.0" encoding="utf-8"?>
<TableRow
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
style="@style/tr_style">
<TextView
style="@style/tv_style"
android:text="@string/spieler1" />
<TextView
android:id="@+id/pkt_spieler1"
style="@style/tv_style" />
</TableRow>