I am dynamically adding rows with two columns to the table. One of the columns contains text that will be spread over several lines. I added weight according to the layout options for text viewing so that it no longer loops off the screen, but it seems to be limited to two and half lines displayed in the table, no matter how long the multiline text lasts. The table is defined only in xml and everything else is done programmatically.
TableRow.LayoutParams rowParams = new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT); TableRow.LayoutParams paramsStar = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT); paramsStar.setMargins(0,0,40,0); TableRow.LayoutParams paramsText = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.FILL_PARENT, (float)1.0); TableRow tr = new TableRow(this); tr.setLayoutParams(rowParams); TextView viewStar = new TextView(this); viewStar.setTextSize((float) 30.0); viewStar.setText("*"); viewStar.setLayoutParams(paramsStar); viewStar.setTypeface(Typeface.DEFAULT_BOLD, 2); TextView viewText = new TextView(this); viewText.setText("Long multiline text piece");
How to fix this vertical crop? Screenshot below:
Here is a link showing the problem
source share