码迷,mamicode.com
首页 > 其他好文 > 详细

TableLayout 里的TextView等组的LayoutParams参数问题

时间:2014-07-13 13:27:18      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:style   color   问题   代码   line   new   

TableLayout 里的TextView等组的LayoutParams参数不能是LinearLayout.LayoutParams这样来定义,

只能是用TableRow.LayoutParams

 

代码如下:

 

TableLayout.LayoutParams lpRow = new TableLayout.LayoutParams(
TableLayout.LayoutParams.FILL_PARENT,
TableLayout.LayoutParams.WRAP_CONTENT);
lpRow.leftMargin = 5;


TableRow.LayoutParams lpEdt = new TableRow.LayoutParams(
TableRow.LayoutParams.FILL_PARENT, 38);
lpEdt.topMargin = 6;
lpEdt.bottomMargin = 6;

TableRow.LayoutParams lpEdt2 = new TableRow.LayoutParams(
TableRow.LayoutParams.FILL_PARENT,
TableRow.LayoutParams.WRAP_CONTENT);
lpEdt2.topMargin = 6;
lpEdt2.bottomMargin = 6;

TableRow lay = new TableRow(layIndex.getContext());
//lay.setLayoutParams(lpRow);
layIndex.addView(lay, new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT));

TableLayout 里的TextView等组的LayoutParams参数问题,布布扣,bubuko.com

TableLayout 里的TextView等组的LayoutParams参数问题

标签:style   color   问题   代码   line   new   

原文地址:http://www.cnblogs.com/zmc/p/3840746.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!