user1705339
user1705339

Reputation: 35

grid view picture puzzle formation error in android

i.setLayoutParams(new GridView.LayoutParams(iwidth  , iheight ));
            i.setImageBitmap(duplicate.get(arg0));
            i.setPadding(1, 1, 1, 1);

I am using the above to provide spaces actually i'm splitting an image and using gridview for placing the splitted images in gridview allowing the user to play picture puzzle in grid view but the splitted images are not fitted exactly in grid view the moddle row images are shrink and the right side images are enlarged one more issue is spacing between them ,it is providing spaces as from one row to next row but it's not providing spaces column to column can any one help me

Upvotes: 0

Views: 229

Answers (1)

dmon
dmon

Reputation: 30168

I just looked at the docs and there's a setVerticalSpacing() and a setHorizontalSpacing() methods. Check them out.

So instead of setting the spacing in the ImageView, you can set it at the grid level.

Upvotes: 1

Related Questions