Android的TableLayout + TableRow虽然使用有点复杂,但是功能很强大
android:collapseColumns:以第0行为序,隐藏指定的列。
android:collapseColumns=0,2--------------意思是把第0和第2列去掉


 TableLayout tableLayout = (TableLayout)findViewById(R.id.TableLayout01);           //全部列自动填充空白处           tableLayout.setStretchAllColumns(true);           //生成10行,8列的表格           for(int row=0;row<10;row++)           {               TableRow tableRow=new TableRow(this);               for(int col=0;col<8;col++)               {                   //tv用于显示                   TextView tv=new TextView(this);                   tv.setText("("+col+","+row+")");                   tableRow.addView(tv);               }               //新建的TableRow添加到TableLayout               tableLayout.addView(tableRow, new TableLayout.LayoutParams(FP, WC));           }       } 

更多相关文章

  1. Android(安卓)全屏设置
  2. android去除ImageButton白色边框
  3. android设置全屏以及解决设置全屏无效的方法
  4. Android中利用GridView实现水平和垂直均有滚动条的表格效果
  5. android去掉系统默认标题栏
  6. android shape实现边框圆角
  7. Android中利用GridView实现水平和垂直均有滚动条的表格效果
  8. Android(安卓)去掉title
  9. android 设置 dialog位置

随机推荐

  1. android获取短信验证码自动填入
  2. android 朗读tts_如何设置Android以大声
  3. Android(CM)源码国内镜像下载
  4. 【Android(安卓)Studio】Android(安卓)St
  5. Android(安卓)Context详解
  6. Android(安卓)UI 中 gravity 与 layout_g
  7. android开关控件使用(一)
  8. EditText焦点问题
  9. android 图片画画板
  10. Android(安卓)设置圆角背景