how to display 2D array in gridlayout

…衆ロ難τιáo~ 提交于 2019-12-02 05:13:02

Simple thing you can do is, you can convert 2D array to a simple 1D array (using a for loop) and proceed as usual. And if you need to set the items dynamically (I mean, if you do not know the dimensions of the array before hand), then you have use the setColumnCount() to set the number of columns you need (5,9,13 in your examples). You don't have to wo0rry about the number rows as Android takes care of the rows. And yes, you should use BaseAdapter.

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