public void responsePost(Editable editable)
{
TableLayout chatbox = (TableLayout)findViewById(R.id.chatbox);
TableRow tr1 = new TableRow(this);
tr1.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
TextView textview = new TextView(this);
textview.setText(editable);
// textview.getTextColors(R.color.)
textview.setTextColor(Color.YELLOW);
tr1.addView(textview);
chatbox.addView(tr1, new TableLayout.LayoutParams(
LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
textview.setGravity(Gravity.RIGHT);
}
How can i make it go ALL THE WAY to the right? and not just a little bit? I used setGravity(Gravity.RIGHT) but that did not work.
I need a little more detail, I couldn’t duplicate your layout, what do you have in your main layout, and what code do you have in onCreate for the activity?
All you need is to set columns to stretchable:
and you need one extra row, leave it blank
for example the complete code could be: