I got some trouble with the TableLayout Android. I wanna create a table with symmetric rows/columns, i.e. a layout where every TextView in it gets allocated exactly the same amount of space like all the others, no matter what text has been appended to it.
It’s important that this can be done by the use of Java-code, not the XML-files.
It would be probably good to know that this layout requires two tables to be next to each other, i.e. every table has just 50% of the screen size. I suppose this makes several LayoutParameter unavailable (e.g. FILL_PARENT)?
This is what I tried:
for (String s : buffer) {
TextView tv = new TextView(this);
tv.setLayoutParams(new TableRow.LayoutParams(0x00, LayoutParams.WRAP_CONTENT, 1f));
tv.append(s);
row.addView(tv, new TableRow.LayoutParams(LayoutParams.FILL_PARENT));
}
Still looks bad though.
This will create two columns that share’s the width in an orderly fashion.
Edit: Same thing, but now in code: