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

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

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

TableLayout.setBackgroundColor介绍

暂无

代码示例

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

TableLayout.LayoutParams tableParams = 
        new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, 
                       TableLayout.LayoutParams.MATCH_PARENT, 1f);
   TableLayout.LayoutParams rowParams = 
        new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 1f);
       TableRow.LayoutParams itemParams = 
        new TableRow.LayoutParams(LayoutParams.FILL_PARENT, 
                     LayoutParams.FILL_PARENT, 1f);
       TableLayout tableLayout = new TableLayout(MainActivity.this);
       tableLayout.setLayoutParams(tableParams);
       tableLayout.setBackgroundColor(0xff7434a6);
       for (int row = 0; row < 2; row++) {
         TableRow tableRow = new TableRow(MainActivity.this);
         tableRow.setLayoutParams(rowParams);
         for (int column = 0; column < 2; column++) {
           Random color = new Random();
           int randomColor = 
            Color.argb(255, color.nextInt(256), 
                    color.nextInt(256),
                    color.nextInt(256));
           TextView textView = new TextView(MainActivity.this);
           textView.setLayoutParams(itemParams);
           textView.setBackgroundColor(randomColor);
           tableRow.addView(textView);
         }
         tableLayout.addView(tableRow);
       }

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

tableLayout.setBackgroundColor(Color.WHITE);

代码示例来源:origin: BasicAirData/GPSLogger

public void ontoggleRecordGeoPoint(View view) {
  if (isAdded()) {
    final Boolean grs = gpsApplication.getRecording();
    boolean newRecordingState = !grs;
    gpsApplication.setRecording(newRecordingState);
    EventBus.getDefault().post(EventBusMSG.UPDATE_TRACK);
    tableLayoutGeoPoints.setBackgroundColor(newRecordingState ? getResources().getColor(R.color.colorPrimary) : getResources().getColor(R.color.colorTrackBackground));
  }
}

代码示例来源:origin: BasicAirData/GPSLogger

public void onPlacemarkRequest(View view) {
  if (isAdded()) {
    final Boolean pr = gpsApplication.getPlacemarkRequest();
    boolean newPlacemarkRequestState = !pr;
    gpsApplication.setPlacemarkRequest(newPlacemarkRequestState);
    tableLayoutPlacemarks.setBackgroundColor(newPlacemarkRequestState ? getResources().getColor(R.color.colorPrimary) : getResources().getColor(R.color.colorTrackBackground));
  }
}

代码示例来源:origin: BasicAirData/GPSLogger

public void Update() {
    if (isAdded()) {
      final Track track = gpsApplication.getCurrentTrack();
      final Boolean grs = gpsApplication.getRecording();
      final Boolean pr = gpsApplication.getPlacemarkRequest();
      if (track != null) {
        if (TVGeoPoints != null)
          TVGeoPoints.setText(String.valueOf(track.getNumberOfLocations()));
        if (TVPlacemarks != null)
          TVPlacemarks.setText(String.valueOf(track.getNumberOfPlacemarks()));
        if (tableLayoutGeoPoints != null)
          tableLayoutGeoPoints.setBackgroundColor(grs ? getResources().getColor(R.color.colorPrimary) : getResources().getColor(R.color.colorTrackBackground));
        if (tableLayoutPlacemarks != null)
          tableLayoutPlacemarks.setBackgroundColor(pr ? getResources().getColor(R.color.colorPrimary) : getResources().getColor(R.color.colorTrackBackground));
      }
    }
  }
}

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

table.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
    LayoutParams.MATCH_PARENT));
table.setBackgroundColor(Color.DKGRAY);

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

table.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
    LayoutParams.WRAP_CONTENT));
table.setBackgroundColor(Color.parseColor("#F87907"));

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

monthView.setBackgroundColor(Color.BLUE);

相关文章