android.widget.TableLayout.removeAllViews()方法的使用及代码示例

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

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

TableLayout.removeAllViews介绍

暂无

代码示例

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

@Override
public void hideBoxScore() {
  scrollView.setVisibility(View.GONE);
  playersTable.removeAllViews();
  statsTable.removeAllViews();
}

代码示例来源:origin: realtime-framework/MessagingAndroidChat

private void clearChannelsList() {
  TableLayout chatRoomsTable = (TableLayout) findViewById(R.id.chatRoomTable);
  chatRoomsTable.removeAllViews();
}

代码示例来源:origin: infinum/android_dbinspector

private void showByPragma(PragmaType pragmaType) {
  lastPragmaType = pragmaType;
  showingContent = false;
  tableLayout.removeAllViews();
  List<TableRow> rows = adapter.getByPragma(pragmaType);
  for (TableRow row : rows) {
    tableLayout.addView(row);
  }
  contentHeader.setVisibility(View.GONE);
}

代码示例来源:origin: stackoverflow.com

public void addButtons(View view) {
  TableLayout tableLayout = (TableLayout) findViewById(R.id.tablelayout);
  Context context = getApplicationContext();
  tableLayout.removeAllViews();

  for (int rowIndex = 0; rowIndex < ROWS; rowIndex++) {
    TableRow row = new TableRow(context);
    for (int columnIndex = 0; columnIndex < COLUMNS; columnIndex++) {
      Button btn = new Button(context);
      LayoutParams buttonParams = new LayoutParams(0,
          LayoutParams.WRAP_CONTENT, 1f);
      btn.setLayoutParams(buttonParams);
      row.addView(btn);
    }
    tableLayout.addView(row);
  }
}

代码示例来源:origin: stackoverflow.com

public void fillGrid(Cursor c){
   TableLayout tl = (TableLayout) findViewById(R.id.players_table);
   tl.removeAllViews();
   for(c.moveToFirst(); c.getPosition() < c.getCount(); c.moveToNext()){
     TableRow tr = new TableRow(this);
     TextView tv = new TextView(this);
     tv.setText(c.getString(1));
     tr.addView(tv);
     tl.addView(tr);
   }
   c.close();
 }

代码示例来源:origin: stackoverflow.com

private void fillTable(final int n, final double[][] matrix, TableLayout table) {
table.removeAllViews();
for (int i = 0; i < n; i++) {
  TableRow row = new TableRow(MainActivity.this);
  row.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));

  for (int j = 0; j < n; j++) {
    EditText edit = new EditText(OutputActivity.this);
    edit.setInputType(InputType.TYPE_CLASS_NUMBER|InputType.TYPE_NUMBER_FLAG_DECIMAL|InputType.TYPE_NUMBER_FLAG_SIGNED);
    edit.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));

    edit.setText(Double.toString(matrix[i][j]));

    edit.setKeyListener(null);
    row.addView(edit);
  }
  table.addView(row);
}
}

代码示例来源:origin: infinum/android_dbinspector

private void showContent() {
  showingContent = true;
  tableLayout.removeAllViews();
  List<TableRow> rows = adapter.getContentPage();
  for (TableRow row : rows) {
    tableLayout.addView(row);
  }
  currentPageText.setText(adapter.getCurrentPage() + "/" + adapter.getPageCount());
  contentHeader.setVisibility(View.VISIBLE);
  nextButton.setEnabled(adapter.hasNext());
  previousButton.setEnabled(adapter.hasPrevious());
}

代码示例来源:origin: firelotus/Meteorite

@Override
public void onClick(View v) {
  tableLayout.removeAllViews();
  customQuery.setVisibility(View.GONE);

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

private void startLiveData() {
  Log.d(TAG, "Starting live data..");
  tl.removeAllViews(); //start fresh
  doBindService();
  currentTrip = triplog.startTrip();
  if (currentTrip == null)
    showDialog(SAVE_TRIP_NOT_AVAILABLE);
  // start command execution
  new Handler().post(mQueueCommands);
  if (prefs.getBoolean(ConfigActivity.ENABLE_GPS_KEY, false))
    gpsStart();
  else
    gpsStatusTextView.setText(getString(R.string.status_gps_not_used));
  // screen won't turn off until wakeLock.release()
  wakeLock.acquire();
  if (prefs.getBoolean(ConfigActivity.ENABLE_FULL_LOGGING_KEY, false)) {
    // Create the CSV Logger
    long mils = System.currentTimeMillis();
    SimpleDateFormat sdf = new SimpleDateFormat("_dd_MM_yyyy_HH_mm_ss");
    try {
      myCSVWriter = new LogCSVWriter("Log" + sdf.format(new Date(mils)).toString() + ".csv",
          prefs.getString(ConfigActivity.DIRECTORY_FULL_LOGGING_KEY,
              getString(R.string.default_dirname_full_logging))
      );
    } catch (FileNotFoundException | RuntimeException e) {
      Log.e(TAG, "Can't enable logging to file.", e);
    }
  }
}

代码示例来源:origin: sdwfqin/AndroidSamples

mTable1.removeAllViews();

代码示例来源:origin: stackoverflow.com

// try this
TableLayout tableLayout = (TableLayout)findViewById(R.id.tabContentLayout);
   tableLayout.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT,TableLayout.LayoutParams.WRAP_CONTENT));
   tableLayout.removeAllViews();
   for(int i=0;i<rows.length;i++){
     Log.d("Rows",rows[i]);
     String row  = rows[i];
     TableRow tableRow = new TableRow(this);
     tableRow.setBackgroundResource(R.drawable.cell_shape);
     tableRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
     final String[] cols = row.split(";");
     Log.i(LOG_CLASS, "<<---- Columns count : " + cols.length + " ---->>");
     for (int j = 0; j < cols.length; j++) {
       final String col = cols[j];
       TextView columsView = new TextView(getApplicationContext());
       columsView.setBackgroundResource(R.drawable.cell_header);
       columsView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
       columsView.setTextColor(color.white);
       columsView.setTextSize(TypedValue.COMPLEX_UNIT_SP,15);
       columsView.setGravity(Gravity.CENTER);
       columsView.setText(String.format("%7s", col));
       Log.d("Cols", String.format("%7s", col));
       tableRow.addView(columsView);
     }
     tableLayout.addView(tableRow);
   }
   tableLayout.requestLayout();

代码示例来源:origin: stackoverflow.com

TableLayout table = (TableLayout)MainActivity.this.findViewById(R.id.mainTable);
 table.removeAllViews();
 TableRow row = new TableRow(this);
 ed = new EditText(this); 
 row.addView(ed);
 table.addView(row);
 table.requestLayout();

代码示例来源:origin: stackoverflow.com

valueTV= new TextView[numProvinces];
tl.removeAllViews();
tl.refreshdrawablestate();

代码示例来源:origin: stackoverflow.com

int rows = Integer.parseInt(rowstring);
int cols = Integer.parseInt(colstring);
table_layout.removeAllViews();
createTable(rows, cols);

代码示例来源:origin: realtime-framework/MessagingAndroidChat

@Override
protected void onResume() {
  super.onResume();
  pause = false;
  mIsInForegroundMode = true;
  OrtcHandler.selfHandler.messagesView = this;
  channel = getIntent().getStringExtra("channel");
  setTitle(channel);
  TableLayout tableMessages = (TableLayout) findViewById(R.id.tableMessages);
  tableMessages.removeAllViews();
  loadMsg();
}

代码示例来源:origin: stackoverflow.com

table.removeAllViews();
table.addView(row3);

代码示例来源:origin: zulip/zulip-android

private void setUpReactions(MessageHolder messageHolder, Message message) {
  try {
    messageHolder.reactionsTable.removeAllViews();
    if (message.getReactions().isEmpty()) {
      return;

代码示例来源:origin: firelotus/Meteorite

public void refreshTable(int d )
  tableLayout.removeAllViews();
  if(d==0)

代码示例来源:origin: shrikanth7698/Collapsible-Calendar-View-Android

String formattedDate = dateFormat.format(mAdapter.getCalendar());
mTxtTitle.setText(formattedDate);
mTableHead.removeAllViews();
mTableBody.removeAllViews();

代码示例来源:origin: stackoverflow.com

tableLayout.removeAllViews();

相关文章