本文整理了Java中android.widget.TableLayout.getChildAt()
方法的一些代码示例,展示了TableLayout.getChildAt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableLayout.getChildAt()
方法的具体详情如下:
包路径:android.widget.TableLayout
类名称:TableLayout
方法名:getChildAt
暂无
代码示例来源:origin: stackoverflow.com
TableLayout tblLayout = (TableLayout)findViewById(R.id.tableLayout);
TableRow row = (TableRow)tblLayout.getChildAt(0); // Here get row id depending on number of row
Button button = (Button)row.getChildAt(XXX); // get child index on particular row
String buttonText = button.getText().toString();
代码示例来源:origin: stackoverflow.com
TableLayout tableLayout = null;
for(int n = 0, s = tableLayout.getChildCount(); n < s; ++n) {
TableRow row = (TableRow)tableLayout.getChildAt(n);
TextView name = (TextView)row.findViewById(R.id.tv_name);
}
代码示例来源:origin: stackoverflow.com
TableLayout table = (TableLayout) findViewById(R.id.give_it_an_id);
TextView courtText;
// For each row
for (int i = 0; i < table.getChildCount(); i++) {
// Get the one `courtText` in this row
courtText = table.getChildAt(i).findViewById(R.id.courtText);
if (courtText != null) {
// Do something to `courtText`
}
}
代码示例来源:origin: stackoverflow.com
final ScrollView sv = (ScrollView) findViewById(R.id.scrollView1);
TableLayout tl = (TableLayout) findViewById(R.id.arrivalstable);
int index = 40;
final View child = tl.getChildAt(index);
new Handler().post(new Runnable() {
@Override
public void run() {
sv.smoothScrollTo(0, child.getBottom());
}
});
代码示例来源:origin: stackoverflow.com
TableLayout contact_table = (TableLayout)findViewById(R.id.contact_table);
final View row=contact_table.getChildAt(i);
row.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v){
// TODO Auto-generated method stub
row_id=contact_table.indexOfChild(row);
}
});
代码示例来源:origin: stackoverflow.com
TableLayout x = (TableLayout) findViewById(R.id.table_id);
for(int i=0;i<x.getChildCount();i++){
TableRow tr = (TableRow) x.getChildAt(index);
//Do here with table row, what u want to do.
}
代码示例来源:origin: stackoverflow.com
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo){
TableLayout yourTable = (TableLayout) findViewById(R.id.yourTableId);
TableRow yourTableRow = yourTable.getChildAt(INDEX_OF_YOUR_ROW_IN_THE_TABLE);
if(v.getId() == yourTableRow.getId()){
yourTable.removeView(yourTableRow);
}
}
代码示例来源:origin: stackoverflow.com
int index = 0;
TableLayout tableLayout = findViewById(R.id.table_layout);
for(int n = 0, s = tableLayout.getChildCount(); n < s; ++n) {
double debt = debtList.get(index);
double fee = feeList.get(index);
TableRow row = (TableRow) tableLayout.getChildAt(n);
TextView cell = (TextView) row.findViewById(R.id.textview_cell);
name.setText("debt = " + debt + ", fee = " + fee);
index++;
}
代码示例来源:origin: stackoverflow.com
public void anotherMethod(){
TableLayout tl = (TableLayout) findViewById(R.id.table_layout);
int tableRowIndex = 0;
TableRow tr = (TableRow) tl.getChildAt(tableRowIndex);
int textViewIndex = 1;
TextView textView = (TextView) tr.getChildAt(textViewIndex);
textView.setText("New Text");
}
代码示例来源:origin: stackoverflow.com
private View getCellAtPos(TableLayout table, int pos) {
TableRow row = (TableRow) table.getChildAt(pos / NUMBER_OF_COLUMNS);
return row.getChildAt(pos % NUMBER_OF_COLUMNS);
}
代码示例来源:origin: stackoverflow.com
TableLayout tblLayout = (TableLayout)findViewById(R.id.tableLayout);
TableRow row = (TableRow)tblLayout.getChildAt(YYY); // Here get row id depending on number of row
Edittext edittext= (Edittext)row.getChildAt(XXX);
String text = edittext.gettext().toString();
代码示例来源:origin: stackoverflow.com
for (int i = 1000 + miTlCnt; i > 1000; i--)
{
TableLayout tl = (TableLayout)findViewById(i);
if (tl != null)
{
for (int j = 0; j < tl.getChildCount(); j++)
{
TableRow row = (TableRow)tl.getChildAt(j);
CheckBox chkCompleted = (CheckBox)row.getChildAt(1);
}
}
}
代码示例来源:origin: stackoverflow.com
....
onClick(View v) {
final TableLayout rel=(TableLayout)findViewById(R.id.tab1);
for(int x=0; x<rel.getChildCount(); x++)
{
View v = rel.getChildAt(x);
rel.removeView(v);
}
....
}
代码示例来源:origin: stackoverflow.com
TableLayout table = (TableLayout) findViewById(R.id.tblScores);
for(int i = 0; i < table.getChildCount(); i = 0)
{
View child = table.getChildAt(0);
if (child != null && child instanceof TableRow)
{
TableRow row = (TableRow) child;
row.removeAllViews();
table.removeViewAt(i);
}
}
代码示例来源:origin: stackoverflow.com
TableLayout layout=(TableLayout) findViewById(R.id.Layout);
for(int i=0;i<layout.getChildCount();i++) {
if (layout.getChildAt(i) instanceof TableRow) {
TableRow tableRow = (TableRow) layout.getChildAt(i);
for(int j=0;j<tableRow.getChildCount();j++) {
if (tableRow.getChildAt(j) instanceof Button) {
Button button = (Button) tableRow.getChildAt(j);
//your button is here
}
}
}
}
代码示例来源:origin: stackoverflow.com
TableLayout layout = (TableLayout) findViewById(R.id.IdTable);
for (int i = 0; i < layout.getChildCount(); i++) {
View child = layout.getChildAt(i);
if (child instanceof TableRow) {
TableRow row = (TableRow) child;
for (int x = 0; x < row.getChildCount(); x++) {
View view = row.getChildAt(x);
view.setEnabled(false);
}
}
}
代码示例来源:origin: stackoverflow.com
TableLayout tl;
tl=(TableLayout)findViewById(R.id.layout);
for(int i=0;i<tl.getChildCount();i++){
View v=tl.getChildAt(i);
if(v instanceof TableRow){
for(int j=0;j<v.getChildCount();j++){
View innerView=v.getChildAt(j);
if(innerView instanceof ImageView){
imageList.add((ImageView)innerView);
idList.add(innerView.getId());
}
}
}
}
代码示例来源:origin: stackoverflow.com
TableLayout layout = (TableLayout) findViewById(R.id.Table_ID);
for (int i = 0; i < layout.getChildCount(); i++) {
View child = layout.getChildAt(i);
if (child instanceof TableRow) {
TableRow row = (TableRow) child;
for (int x = 0; x < row.getChildCount(); x++) {
View view = row.getChildAt(x);//Here you get Your Button View
}
}
}
代码示例来源:origin: stackoverflow.com
TableLayout tbL = (TableLayout) findViewById(R.id.tbL);
TableRow row1=(TableRow)tbL.getChildAt(0);
SeekBar sb1=(SeekBar) row1.getChildAt(0);
TextView txt1_1=(TextView) row1.getChildAt(1);
TextView txt1_2=(TextView) row1.getChildAt(2);
..etc
代码示例来源:origin: stackoverflow.com
TableLayout table = (TableLayout)findViewById(R.id.scrollable_part);
int sourceColumnIndex = 0;
int targetColumnIndex = 1;
for (int i = 0; i < table.getChildCount(); i++)
{
TableRow tr = (TableRow)table.getChildAt(i);
View v = tr.getChildAt(sourceColumnIndex);
tr.removeViewAt(sourceColumnIndex);
tr.addView(v, targetColumnIndex);
}
内容来源于网络,如有侵权,请联系作者删除!