Android expandable GridView like Google images

偶尔善良 提交于 2019-12-07 00:37:31

问题


I would like to create expandable GridView which will behave similar to Google images page. I would like to know how can I achieve such functionality: when I click one of the images, page expands and shows details of the picture. Is it possible to do something similar in Android?

Images grid:

Expanded images grid:


回答1:


I think the reason you haven't received any responses is because of the wording of the question. When I first saw it I thought, something similar to expandable listview. See this tutorial.

But anyway, to achieve what you want, you need to set the "expansion" function in the OnClickListener in your GridView. I would suggest have a dialog activity with the layout you need (image with text/links/etc) and on each item click, popup the dialog. It will look very similar to what Google images has.



来源:https://stackoverflow.com/questions/14998125/android-expandable-gridview-like-google-images

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