由网友(你好特别i)分享简介:是否有可能一个TableLayout绑定一个ArrayAdapter?Is it possible to bind a TableLayout with a ArrayAdapter?推荐答案有一个在该框架没有这样的API。您可以通过查询自己的适配器做手工。事情是这样的:There is no such API...
是否有可能一个TableLayout绑定一个ArrayAdapter?
Is it possible to bind a TableLayout with a ArrayAdapter?
推荐答案
有一个在该框架没有这样的API。您可以通过查询自己的适配器做手工。事情是这样的:
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));
}
相关推荐
最新文章