Custom Gallery Thumbnails in Android

有些话、适合烂在心里 提交于 2019-12-11 07:01:34

问题


Thanks for reading!

I am using the Android Gallery tutorial and wondering if there's a way to customize the thumbnails of the gallery> For eg: Display caption ON the image?

Thanks!


回答1:


After trying all approaches suggested here, I wasn't able to still get a custom gallery the way I wanted it to. I kept running into ClassCastException. So, here's what worked for me till now. This is just a workaround and incase someone comes up with a better way to design a custom gallery - do post your answer here so I can accept it.

Thanks for helping out!




回答2:


You can completely customize your Gallery items. Just return whatever View you want from the getView method of the ImageAdapter.

(I assume your are using this tutorial)



来源:https://stackoverflow.com/questions/5517101/custom-gallery-thumbnails-in-android

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