本文整理了Java中com.google.api.services.bigquery.model.TableRow
类的一些代码示例,展示了TableRow
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableRow
类的具体详情如下:
包路径:com.google.api.services.bigquery.model.TableRow
类名称:TableRow
[英]Model definition for TableRow.
This is the Java data model class that specifies how to parse/serialize into the JSON that is transmitted over HTTP when working with the BigQuery API. For a detailed explanation see: https://developers.google.com/api-client-library/java/google-http-java-client/json
[中]TableRow的模型定义。
这是一个Java数据模型类,指定在使用BigQuery API时如何解析/序列化为通过HTTP传输的JSON。有关详细说明,请参见:https://developers.google.com/api-client-library/java/google-http-java-client/json
代码示例来源:origin: stackoverflow.com
TableRow tbrow0 = new TableRow(this);
TextView tv0 = new TextView(this);
tv0.setText(" Sl.No ");
tv0.setTextColor(Color.WHITE);
tbrow0.addView(tv0);
tbrow0.addView(tv1);
tbrow0.addView(tv2);
tbrow0.addView(tv3);
stk.addView(tbrow0);
for (int i = 0; i < 25; i++) {
TableRow tbrow = new TableRow(this);
tbrow.addView(t1v);
tbrow.addView(t2v);
tbrow.addView(t3v);
tbrow.addView(t4v);
stk.addView(tbrow);
代码示例来源:origin: googleapis/google-cloud-java
@Override
public FieldValueList apply(TableRow rowPb) {
return FieldValueList.fromPb(rowPb.getF(), null);
}
}));
代码示例来源:origin: stackoverflow.com
TableRow tr = new TableRow(this);
TableLayout.LayoutParams tableRowParams=
new TableLayout.LayoutParams
(TableLayout.LayoutParams.FILL_PARENT,TableLayout.LayoutParams.WRAP_CONTENT);
int leftMargin=10;
int topMargin=2;
int rightMargin=10;
int bottomMargin=2;
tableRowParams.setMargins(leftMargin, topMargin, rightMargin, bottomMargin);
tr.setLayoutParams(tableRowParams);
代码示例来源:origin: stackoverflow.com
TableRow tr1 = new TableRow(this);
for (Entry<String, Integer> entry : map.entrySet()) {
tv.setText(entry.getKey());
tv2.setText((Integer)entry.getValue()); //Error occures here
tv.setGravity(Gravity.LEFT);
tv2.setGravity(Gravity.RIGHT);
tr1.addView(tv);
tr1.addView(tv2);
tl.addView(tr1, new TableLayout.LayoutParams(
LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
}
}
代码示例来源:origin: stackoverflow.com
/* Find Tablelayout defined in main.xml */
TableLayout tl = (TableLayout) findViewById(R.id.SaleOrderLines);
/* Create a new row to be added. */
TableRow tr = new TableRow(this);
tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
/* Create a Button to be the row-content. */
Button b = new Button(this);
b.setText("Dynamic Button");
b.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
/* Add Button to row. */
tr.addView(b);
/* Add row to TableLayout. */
//tr.setBackgroundResource(R.drawable.sf_gradient_03);
tl.addView(tr, new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));
代码示例来源:origin: stackoverflow.com
TableLayout layout = (TableLayout)mainLayout.findViewById(R.id.my_table_layout_id);
for(int i = 0; i < 10; i++) {
row = new TableRow(this);
View layout_number = inflater.inflate(R.layout.inflate_number, layout, false);
TextView number = (TextView) layout_number.findViewById(R.id.Number);
number.setTag(i);
number.setText(Integer.toString(i));
row.addView(number);
layout.addView(row);
}
代码示例来源:origin: stackoverflow.com
TableLayout tableLayoutTransactionLineHeading = (TableLayout) findViewById(R.id.tablelayout);
for(int j=0; j<rows; j++){
TableRow tableRow = new TableRow(this);
tableRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
TextView lineno = new TextView(this);
lineno.setText(lineNo[j]);
lineno.setPadding(10, 10, 10, 10);
lineno.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
tableRow.addView(lineno);
View v = new View(this);
v.setLayoutParams(new TableRow.LayoutParams(1, TableRow.LayoutParams.MATCH_PARENT));
v.setBackgroundColor(Color.rgb(50, 50, 50));
tableRow.addView(v);
tableLayout.addView(tableRow, new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT,0f));
}
代码示例来源:origin: stackoverflow.com
TableRow tr = new TableRow(this);
tr.setClickable(true);
tr.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
TextView title = ((TextView)genericView.findViewById(R.id.listItemFirstLine));
title.setTextColor(Color.BLACK);
title.setTextSize(20);
title.setText(c5.getString(6));
tr.addView(genericView);
代码示例来源:origin: stackoverflow.com
TableLayout tb = new TableLayout(this);
TableRow tr = new TableRow(this);
TextView tv = new TextView(this);
tv.setText("row");
tr.addView(tv);
tb.addView(tr); // this is what I mean
setContentView(tb);
代码示例来源:origin: stackoverflow.com
public class SeleccionarJugador extends Activity {
private TableLayout mTablaJugadores;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
// Se establece el layout
setContentView(R.layout.jugadores);
// Se recupera la tabla donde se insertán los jugadores de ambos equipos
mTablaJugadores = (TableLayout) findViewById(R.id.tabla_jugadores);
LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
TableRow fila = new TableRow(this);
View v = inflater.inflate(R.layout.fila_seleccionar_jugadores,null);
TextView dorsal = (TextView) v.findViewById(R.id.dorsal);
dorsal.setText(String.valueOf(11));
TextView nombre = (TextView) v.findViewById(R.id.nombre);
nombre.setText("Pepe");
TextView posicion = (TextView) v.findViewById(R.id.posicion);
posicion.setText("Lateral");
fila.addView(v);
mTablaJugadores.addView(fila);
}
代码示例来源:origin: stackoverflow.com
private View tableChild() {
TableRow tr = new TableRow(this);
View v = LayoutInflater.from(mContext).inflate(R.layout.layout_for_my_table_row, tr, false);
//want to get childs of row for example TextView, get it like this:
TextView tv = (TextView)v.findViewById(R.id.my_row_text_view);
tv.setText("This is another awesome way for dynamic custom layouts.");
return v;//have to return View child, so return made 'v'
}
代码示例来源:origin: stackoverflow.com
TableLayout mTableLayout = new TableLayout(this);
mTableLayout.setLayoutParams(new TableLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
for (int count = 0; count < 3; count++) {
TableRow row = new TableRow(this);
row.setLayoutParams((new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT)));
TextView valueTV = new TextView(this);
valueTV.setText("text : "+count);
// valueTV.setId(5);
valueTV.setLayoutParams(new TableRow.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
row.addView(valueTV);
mTableLayout.addView(row);
}
mChartLayout.addView(mTableLayout);
代码示例来源:origin: stackoverflow.com
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ScrollView sv = new ScrollView(this);
TableLayout ll=new TableLayout(this);
HorizontalScrollView hsv = new HorizontalScrollView(this);
for(int i=1;i<5;i++) {
TableRow tbrow=new TableRow(this);
for(int j=1;j<=3;j++) {
TextView tv1=new TextView(this);
tv1.setText("Element :"+ i + "" + j);
tbrow.addView(tv1);
}
ll.addView(tbrow);
View v = new View(this);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 5);
v.setLayoutParams(params);
v.setBackgroundColor(getResources().getColor(android.R.color.white));
ll.addView(v);
}
hsv.addView(ll);
sv.addView(hsv);
setContentView(sv);
}
代码示例来源:origin: stackoverflow.com
TableLayout table = new TableLayout(this);
TableRow tr = new TableRow(this);
tr.setBackgroundColor(Color.BLACK);
tr.setPadding(0, 0, 0, 2); //Border between rows
TableRow.LayoutParams llp = new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
llp.setMargins(0, 0, 2, 0);//2px right-margin
//New Cell
LinearLayout cell = new LinearLayout(this);
cell.setBackgroundColor(Color.WHITE);
cell.setLayoutParams(llp);//2px border on the right for the cell
TextView tv = new TextView(this);
tv.setText("Some Text");
tv.setPadding(0, 0, 4, 3);
cell.addView(tv);
tr.addView(cell);
//add as many cells you want to a row, using the same approach
table.addView(tr);
代码示例来源:origin: stackoverflow.com
HSV.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
TableRow tblRow = new TableRow(this);
tblRow.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
tblRow.setBackgroundResource(R.drawable.bookshelf);
imageView.setImageResource(R.drawable.book1);
TextView textView = new TextView(this);
textView.setText("Java Tester");
textView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
tblRow.addView(imageView,j);
tblLayout.addView(HSV, i);
代码示例来源:origin: stackoverflow.com
TableLayout prices = (TableLayout)findViewById(R.id.prices);
prices.setStretchAllColumns(true);
prices.bringToFront();
for(int i = 0; i < drug.length; i++){
TableRow tr = new TableRow(this);
TextView c1 = new TextView(this);
c1.setText(drug[i].getName());
TextView c2 = new TextView(this);
c2.setText(String.valueOf(drug[i].getPrice()));
TextView c3 = new TextView(this);
c3.setText(String.valueOf(drug[i].getAmount()));
tr.addView(c1);
tr.addView(c2);
tr.addView(c3);
prices.addView(tr);
}
代码示例来源:origin: stackoverflow.com
public void createTableRow(String textBoxContent,Integer catId) {
TableLayout tl = (TableLayout) findViewById(R.id.SelectCat);
TableRow tr = new TableRow(this);
LayoutParams lp = new LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
tr.setLayoutParams(lp);
tr.setGravity(Gravity.RIGHT);
Button btnLeft = new Button(this);
btnLeft.setLayoutParams(new LayoutParams(0,android.view.ViewGroup.LayoutParams.WRAP_CONTENT,(float) 0.5));
btnLeft.setText(R.string.Show);
btnLeft.setTag(catId);
TextView tvCenter = new TextView(this);
tvCenter.setLayoutParams(new LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT,android.view.ViewGroup.LayoutParams.WRAP_CONTENT, 1f));
tvCenter.setBackgroundColor(Color.WHITE);
tvCenter.setText(textBoxContent);
tr.addView(btnLeft);
tr.addView(tvCenter);
tl.addView(tr, new TableLayout.LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT));
}
代码示例来源:origin: stackoverflow.com
TableRow r1 = new TableRow(this);
r1 .setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
final float scale = this.getResources().getDisplayMetrics().density;
TextView editLabel = new TextView(this);
editLabel.setLayoutParams(new TableRow.LayoutParams(0, TableRow.LayoutParams.WRAP_CONTENT,(int) (1 * scale + 0.5f)));
editLabel.setText("Label");
EditText editText = new EditText(this);
editText.setLayoutParams(new TableRow.LayoutParams(0, TableRow.LayoutParams.WRAP_CONTENT,(int) (1 * scale + 0.5f)));
editText.setMaxLines(1);
r1.addView(editLabel);
r1.addView(editText);
tableLayout1.addView(r1);
代码示例来源:origin: stackoverflow.com
TableLayout tableLayout = new TableLayout(this);
tableLayout.setStretchAllColumns(true);
tableLayout.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.FILL_PARENT));
tableLayout.setWeightSum(3);
for (int i = 0; i < 3; i++) {
TableRow tableRow = new TableRow(this);
tableRow.setGravity(Gravity.CENTER);
tableRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.FILL_PARENT, 1.0f));
for (int j = 0; j < 3; j++) {
TextView button = new TextView(this);
final int buttonNumber = (j + i * 4);
button.setText("" + buttonNumber);
button.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.FILL_PARENT));
tableRow.addView(button);
}
tableLayout.addView(tableRow);
}
main_lay.addView(tableLayout);
代码示例来源:origin: stackoverflow.com
TableLayout tl = new TableLayout(this);
tl.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
TableRow tr = new TableRow(this);
tr.setBackgroundResource(R.color.rowColor);
LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params.setMargins(4, 4, 4, 4);
TextView tv = new TextView(this);
tv.setBackgroundResource(R.color.textviewColor);
tv.setText("hello");
tr.addView(tv, params);
TextView tv2 = new TextView(this);
tv2.setBackgroundResource(R.color.textviewColor);
tv2.setText("hi");
tr.addView(tv2, params);
tl.addView(tr);
setContentView(tl);
内容来源于网络,如有侵权,请联系作者删除!