Is it possible to bind a TableLayout with a ArrayAdapter?

偶尔善良 提交于 2019-11-30 01:20:35

问题


Is it possible to bind a TableLayout with a ArrayAdapter?


回答1:


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));
}


来源:https://stackoverflow.com/questions/5039465/is-it-possible-to-bind-a-tablelayout-with-a-arrayadapter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!