Hello,
I'm trying to load images from url via Picasso, the issue that is loading all images above each other, at the end I can see only one image, I tried to use margin, but it is applying the same margin to all.
When I change the parent to liner layout all images are shown.
Any idea how to solve it, the end result that I need to display the image as a grid of 3 or 2.
Thanks,
I'm trying to load images from url via Picasso, the issue that is loading all images above each other, at the end I can see only one image, I tried to use margin, but it is applying the same margin to all.
When I change the parent to liner layout all images are shown.
Java:
for (int i = 0; i < length; i++) {
JSONObject picObj = pictures.getJSONObject(i);
String pictureName = picObj.getString("name");
int pictureId = picObj.getInt("id");
ImageView imageView = new ImageView(mContext);
imageView.setId(pictureId);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(200, 200);
params.setMargins(pictureId,10+pictureId,20,20);
imageView.setLayoutParams(params);
WebServiceUtils.log(mContext, TAG, "Setting image" + pictureName);
Picasso.get().load(imageUrl+pictureName).into(imageView);
tImagesLayout.addView(imageView);
}
Any idea how to solve it, the end result that I need to display the image as a grid of 3 or 2.
Thanks,