I have a TextView inside a TableRow. The text contained in this TextView is much larger than the screen. Thus, I would like the text to wrap in a few lines.
TableLayout table = (TableLayout)findViewById(R.id.myTable);
TableRow row = new Tablerow(context);
TextView view = new TextView(context);
view.setText(stringWithLotsOfCharacters);
view.setSingleLine(false);
row.add(view);
table.addview(row, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
I tried using "setSingleLine", but that did not have the effect I was looking for.
Any suggestions? Thank.
source
share