How to inflate another layout inside getView() of gridview adapter in android?

那年仲夏 提交于 2019-12-04 03:17:49

do you mean that you wish to add multiple rows in the area that is now being taken by the "Busy" space ? do you want it to take as much space as it needs, or should it be scrollable?

anyway, it seems you are in the right direction. you used a linearLayout to hold the "busy" area, right? so just use a for-loop and put their the data you wish to show.

of course, because the gridView recycles items, you would need to empty the linearLayout every time you reach the getView, but it should still work.

if you wish to use the layoutInflater in the for-loop, that's also possible:

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