android.widget.TableRow.setLayoutParams()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中android.widget.TableRow.setLayoutParams()方法的一些代码示例,展示了TableRow.setLayoutParams()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableRow.setLayoutParams()方法的具体详情如下:
包路径:android.widget.TableRow
类名称:TableRow
方法名:setLayoutParams

TableRow.setLayoutParams介绍

暂无

代码示例

代码示例来源:origin: iSoron/uhabits

private TableRow createTableRow() {
  TableRow row = new TableRow(getContext());
  ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT,
      LayoutParams.WRAP_CONTENT);
  row.setLayoutParams(params);
  return row;
}

代码示例来源:origin: Neamar/KISS

private TableRow createTableRow() {
  TableRow row = new TableRow(getContext());
  ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT,
      LayoutParams.WRAP_CONTENT);
  row.setLayoutParams(params);
  return row;
}

代码示例来源:origin: consp1racy/android-support-preference

@NonNull
private TableRow createTableRow() {
  final TableRow row = new TableRow(getContext());
  final ViewGroup.LayoutParams params =
      new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
  row.setLayoutParams(params);
  return row;
}

代码示例来源:origin: daliyan/MyKeep

private TableRow createTableRow() {
  TableRow row = new TableRow(getContext());
  ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT,
      LayoutParams.WRAP_CONTENT);
  row.setLayoutParams(params);
  return row;
}

代码示例来源:origin: adrianchifor/Swiftnotes

private TableRow createTableRow() {
  TableRow row = new TableRow(getContext());
  ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT,
      LayoutParams.WRAP_CONTENT);
  row.setLayoutParams(params);
  return row;
}

代码示例来源:origin: iotoasis/SI

protected void appendRow( String value ){
  // create table row
  TableLayout tb = (TableLayout)findViewById(R.id.control_table_layout);
  TableRow tableRow = new TableRow(this);
  tableRow.setLayoutParams(tableLayout);
  // get current time
  long time = System.currentTimeMillis();
  SimpleDateFormat dayTime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
  String cur_time = dayTime.format(new Date(time));
  // set Text on TextView
  TextView tv_left = new TextView(this);
  tv_left.setText( cur_time );
  tv_left.setLayoutParams( tableRowLayout );
  tableRow.addView( tv_left );
  TextView tv_right = new TextView(this);
  tv_right.setText( value );
  tv_right.setLayoutParams( tableRowLayout );
  tableRow.addView( tv_right );
  // set table rows on table
  tb.addView(tableRow);
}

代码示例来源:origin: jorgegil96/All-NBA

private void addSeparatorRowToPlayers() {
  TableRow row = new TableRow(getActivity());
  row.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
  View view = LayoutInflater.from(getActivity())
      .inflate(R.layout.box_score_separator, row, false);
  row.addView(view);
  playersTable.addView(row, new TableLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
}

代码示例来源:origin: jjhesk/KickAssSlidingMenu

protected TableRow newTempHolder() {
  TableRow linearLayout_temp = new TableRow(getActivity());
  linearLayout_temp.setLayoutParams(new TableRow.LayoutParams(screen_size.x, row_height));
  return linearLayout_temp;
}

代码示例来源:origin: pires/android-obd-reader

private void addTableRow(String id, String key, String val) {
  TableRow tr = new TableRow(this);
  MarginLayoutParams params = new ViewGroup.MarginLayoutParams(
      LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
  params.setMargins(TABLE_ROW_MARGIN, TABLE_ROW_MARGIN, TABLE_ROW_MARGIN,
      TABLE_ROW_MARGIN);
  tr.setLayoutParams(params);
  TextView name = new TextView(this);
  name.setGravity(Gravity.RIGHT);
  name.setText(key + ": ");
  TextView value = new TextView(this);
  value.setGravity(Gravity.LEFT);
  value.setText(val);
  value.setTag(id);
  tr.addView(name);
  tr.addView(value);
  tl.addView(tr, params);
}

代码示例来源:origin: jjhesk/KickAssSlidingMenu

protected TableRow newTempHolder() {
  TableRow linearLayout_temp = new TableRow(getActivity());
  linearLayout_temp.setLayoutParams(new TableRow.LayoutParams(screen_size.x, row_height));
  return linearLayout_temp;
}

代码示例来源:origin: jorgegil96/All-NBA

private void addSeparatorRowToStats(int columns) {
  TableRow row = new TableRow(getActivity());
  row.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
  for (int i = 0; i < columns; i++) {
    View view = LayoutInflater.from(getActivity())
        .inflate(R.layout.box_score_separator, row, false);
    row.addView(view);
  }
  statsTable.addView(row, new TableLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
}

代码示例来源:origin: labexp/osmtracker-android

tblRow.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT,
    TableLayout.LayoutParams.FILL_PARENT, 1));

代码示例来源:origin: jjhesk/KickAssSlidingMenu

protected TableRow newTempHolderBy2() {
  TableRow linearLayout_temp = new TableRow(getActivity());
  linearLayout_temp.setLayoutParams(new TableRow.LayoutParams(screen_size.x, calculateRowHeightBy2()));
  return linearLayout_temp;
}

代码示例来源:origin: jjhesk/KickAssSlidingMenu

protected TableRow newTempHolderBy2() {
  TableRow linearLayout_temp = new TableRow(getActivity());
  linearLayout_temp.setLayoutParams(new TableRow.LayoutParams(screen_size.x, calculateRowHeightBy2()));
  return linearLayout_temp;
}

代码示例来源:origin: WowzaMediaSystems/gocoder-sdk-samples-android

private void addDataItem(WOWZDataItem dataItem, TableLayout table, String label) {
  TableRow row = new TableRow(getActivity());
  TableRow.LayoutParams rowParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  row.setLayoutParams(rowParams);
  TextView dataLabel = new TextView(getActivity());
  dataLabel.setText(label);
  dataLabel.setTextAppearance(getActivity(), R.style.DataTableLabelAppearance);
  dataLabel.setPadding( 15, 15, 15, 15);
  TableRow.LayoutParams labelParams = new TableRow.LayoutParams(1);
  labelParams.weight = 1.0f;
  labelParams.gravity = Gravity.END;
  dataLabel.setLayoutParams(labelParams);
  TextView dataValue = new TextView(getActivity());
  dataValue.setText(dataItem.toString());
  dataValue.setTextAppearance(getActivity(), R.style.DataTableValueAppearance);
  dataValue.setPadding( 15, 15, 15, 15);
  TableRow.LayoutParams valueParams = new TableRow.LayoutParams(2);
  valueParams.weight = 1.0f;
  dataValue.setLayoutParams(valueParams);
  row.addView(dataLabel);
  dataValue.setText(this.shortenVals(dataValue.getText().toString(),8));
  row.addView(dataValue);
  setRowBackground(row);
  table.addView(row);
}

代码示例来源:origin: WowzaMediaSystems/gocoder-sdk-samples-android

private void addSubSectionFooter(TableLayout table, String label) {
  TableRow row = new TableRow(getActivity());
  TableRow.LayoutParams rowParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  row.setLayoutParams(rowParams);
  TextView dataLabel = new TextView(getActivity());
  //dataLabel.setText(label);
  //dataLabel.setTextAppearance(getActivity(), R.style.DataTableLabelAppearance);
  dataLabel.setPadding( 15, 15, 15, 15);
  //TableRow.LayoutParams labelParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  //TableRow.LayoutParams labelParams = new TableRow.LayoutParams(1);
  //labelParams.weight = 1.0f;
  //labelParams.gravity = Gravity.END;
  //dataLabel.setLayoutParams(labelParams);
  TextView dataValue = new TextView(getActivity());
  dataValue.setText("}" + (label != null ? " (" + label + ")" : ""));
  dataValue.setTextAppearance(getActivity(), R.style.DataTableLabelAppearance);
  dataValue.setPadding( 15, 15, 15, 15);
  TableRow.LayoutParams valueParams = new TableRow.LayoutParams(2);
  valueParams.weight = 1.0f;
  dataValue.setLayoutParams(valueParams);
  row.addView(dataLabel);
  row.addView(dataValue);
  setRowBackground(row);
  table.addView(row);
}

代码示例来源:origin: WowzaMediaSystems/gocoder-sdk-samples-android

row.setBackgroundResource(R.color.dataTableSubHeaderBackground);
TableRow.LayoutParams rowParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
row.setLayoutParams(rowParams);

代码示例来源:origin: jorgegil96/All-NBA

public void addRowToPlayersTable2(String content) {
  TableRow row = new TableRow(getActivity());
  row.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
  int width = (int) UnitUtils.convertDpToPixel(100, getActivity());
  row.setMinimumWidth(width);
  if (content.equals("PLAYER")) {
    TextView tv = addHeaderItem(row, content);
    tv.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
    row.addView(tv);
  } else {
    TextView tv = addNormalItem(row, content);
    tv.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
    row.addView(tv);
  }
  playersTable.addView(row, new TableLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
}

代码示例来源:origin: mkulesh/microMathematics

tableRow.setLayoutParams(tableParams); // TableLayout is the parent view
addView(tableRow);

代码示例来源:origin: jorgegil96/All-NBA

public void displayTeamTotalStats(StatLine statLine){
  TableRow row = new TableRow(getActivity());
  row.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
  row.addView(addNormalItem(row, String.valueOf(statLine.getMin())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getPts())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getReb())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getAst())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getStl())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getBlk())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getBlka())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getOreb())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getDreb())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getFgm())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getFga())));
  row.addView(addNormalItem(row, getShootingPct(statLine.getFga(), statLine.getFgm())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getTpm())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getTpa())));
  row.addView(addNormalItem(row, getShootingPct(statLine.getTpa(), statLine.getTpm())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getFtm())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getFta())));
  row.addView(addNormalItem(row, getShootingPct(statLine.getFta(), statLine.getFtm())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getPf())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getTov())));
  row.addView(addNormalItem(row, String.valueOf(statLine.getPm())));
  statsTable.addView(row, new TableLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
}

相关文章