且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

毕加索图像未在 Gridview Android 中加载

更新时间:2023-01-24 11:32:14

那些行:

//Get the ImageView
ImageView movieThumbnail = (ImageView) rowView.findViewById(R.id.movies_item_thumbnail);

 //Load Image into the ImageView
 Picasso.with(context).load(movies.get(position).getThumbnail()).into(movieThumbnail);

走出if(rowView == null) {

您将始终只有一个 null convertView,并且您必须在更新/填充 GridView 时调用这两行.目前你应该总是一遍又一遍地看到第一个图像.请不要忘记在清单中添加 Internet 权限

You will always get only one null convertView, and you have to call that two lines while you are updating/populating your GridView . At the moment you should see alway the first image over and over. Please don't forget to add the Internet permission to the manifest