Reputation: 64904
I want to to create a grid of images like this :
What I am asking about is how to make the images appear suitably, without being stretched or having a blink spaces. I just what the images (in different sizes) to fit the available spaces. ..
how ? and thanks in advance
Upvotes: 0
Views: 109
Reputation: 200120
Sounds like you are looking for ImageView.ScaleType.CENTER_CROP. CENTER_CROP ensures that every image will fit both the height and width of the allocated space with no gap. You can add to your xml via:
<ImageView
...
android:scaleType="centerCrop" />
Upvotes: 1