TableRow tr1 = new TableRow(context);
TextView hbar = new TextView(context);
tr1.addView(hbar, 0);
tl.addView(tr1,new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));我需要改变textview的位置。
hbar.setPadding(10, 0, 0, 0);不起作用。并且还尝试使用set layoutparams。有什么建议吗?
发布于 2014-07-01 14:11:43
试试这个:
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
//your textview.
tl.setPadding(10,0,0,0);
}https://stackoverflow.com/questions/24503123
复制相似问题