![](/img/trans.png)
[英]How to set expanded ActionView's width in SupportActionBar to fill the available space
[英]How to set an Android TableRow column's width to fill available space?
我有一个以编程方式创建的TableTable,其宽度设置为match_parent。 我将TableRows添加到每个5列。 我将第1、2、4和5列都设置为静态宽度。 如何设置第3列以填充表格中的可用空间,以使5列的总宽度为100%? (将TableRow宽度设置为match_parent不会这样做)
设置第3列布局的weight
,以便它将填充TableRow
的剩余空间
LinearLayout linearLayout = new LinearLayout(this);
TableRow.LayoutParams params = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT,1f);
linearLayout.setLayoutParams(params);
tableRow.addView(linearLayout);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.