Android Gallery issue - gallery size is bigger than expected?

Try using ScaleType. CENTER_CROP instead - this will make the image fit the full height while maintaining it's aspect ratio - ie some of the image on the left and right will not be visible Alternatively you could use ScaleType. FIT_XY this will not maintain the aspect ratio and will stretch the image so that all of the image fits inside the ImageView.

Try using ScaleType. CENTER_CROP instead - this will make the image fit the full height while maintaining it's aspect ratio - ie some of the image on the left and right will not be visible. Alternatively you could use ScaleType.

FIT_XY - this will not maintain the aspect ratio and will stretch the image so that all of the image fits inside the ImageView.

I need aspect ratio saved. CENTER. INSIDE seems to be good, but I still have that grey extra space on bottom and on top.

– Mighter May 11 at 11:40 Try CENTER_CROP then - that maintains aspect ratio. – Joseph Earl May 11 at 11:56 That makes image to be larger that view, CENTER_INSIDE is how I want it to look like, but I don't know why gallery widget itself becomes greater than imageview. – Mighter May 11 at 12:02.

Try changing the layout params of the image view (set the height to fill_parent as well) - Gallery. LayoutParams(LayoutParams. FILL_PARENT, LayoutParams.

FILL_PARENT)).

That's not working. – Mighter May 19 at 18:55.

Android:layout_weight="1" for gridview or parent. You must use "hierarchyviewer" tools for better undestand what layout need to have design priority, for undestand what layout don't fill own parent. I hope that it help you.

I've got Activity with gallery widget alongside with other views. I want gallery to be as wide as my Activity is, and I want my image to match gallery size. I'm a little bit confused with ImageView.

What I need is to get rid of that extra grey part of gallery on top and bottom(marked red). I wonder, why does it have such size? Maybe I do something funny with that scaling type stuff?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions