zoukankan      html  css  js  c++  java
  • TableLayout 里的TextView等组的LayoutParams参数问题

    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));

  • 相关阅读:
    python 基础 7.1 datetime 获得时间
    Python 学习笔记12
    Python 学习笔记11
    Python 学习笔记10
    Python 学习笔记9
    Python 学习笔记8
    Python 学习笔记7
    Python 学习笔记6
    Python 学习笔记5
    Python 学习笔记4
  • 原文地址:https://www.cnblogs.com/zmc/p/3840746.html
Copyright © 2011-2022 走看看