Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有自定义适配器的 gridview。它是通过适配器方法的 notifyDataSetChanged 从后台服务添加照片的。但它的方法重新创建了所有项目。这些项目需要多次创建。物品是照片的一部分的原因。
所以,我想动态添加要添加的项目。
目前尚不清楚您是要添加新视图还是只刷新旧视图。您可以通过调用 getView() 来更新 GridView 中已有的单个视图。这里接受的答案对我来说适用于 ListView,我相信它对于 GridView 来说是相似的。
为了方便加载图像,我推荐Picasso。