I have the following problem spanning dynamically added rows to a TableLayout inside a scroll view. The rows follow this pattern:
Row 1: Cell spanned over the whole
May be it will help to somebody. Even this question was more than 2 years I see the same bug right now. That is, rowSpanLayout.span = 2; doesn't work. But in xml layout_span it works. I found the workable solution: 1. create the layour xml file injection with layout properties:
TableRow.LayoutParams blp; blp = (TableRow.LayoutParams)check1.getLayoutParams(); blp.width = 100; blp.height = 50; TextView tw = new TextView(this); tw.setTextSize(tsEL); tw.setLayoutParams(blp); tw.setText(R.string.empty); tr.addView(tw);
It works.