Is it possible to bind a TableLayout with a ArrayAdapter?

前端 未结 1 1145
误落风尘
误落风尘 2021-01-04 04:14

Is it possible to bind a TableLayout with a ArrayAdapter?

相关标签:
1条回答
  • 2021-01-04 04:41

    There is no such API in the framework. You can do it manually by querying the adapter yourself. Something like this:

    int count = adapter.getCount();
    for (int i = 0; i < count; i++) {
        tableLayout.addView(createTableRow(adapter.getItem(i)); // or tableLayout.addView(adapter.getView(i, null, tableLayout));
    }
    
    0 讨论(0)
提交回复
热议问题