我有一组照片,其中填充了从 web 服务获得的 url。 现在我想将照片显示到 GridView 中,但我似乎可以理解你是如何做到的..
这是我简化后的代码:
public GridView grid1;
public String photos[];
grid1 = (GridView)root.findViewById(R.id.gridphotos);
grid1.setAdapter(new ArrayAdapter<String>(getActivity(),android.R.layout.simple_list_item_1,photos ));
grid1.setTextFilterEnabled(true);
但它只显示链接文本....
我可以使用 WebView 填充适配器吗?
谢谢
最佳答案
您需要通过扩展 ArrayAdapter 或 BaseAdapter 创建自己的适配器。 在此处查看示例.. http://www.learn-android-easily.com/2013/09/android-custom-gridview-example.html
关于android - Android GridView 中图像 URL 的字符串数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24084480/