Search code examples
androidandroid-studioimageviewandroid-imageviewscale

how do I set a minimum scalable value for a ImageView?


let's say I have an image 'A' with 400x400 res in my drawable folder, I have a ImageView source set to A, this ImageView is inside a linear layout or a card layout.

I want the image to scale depending on the device, I want it to be say 120dp X 120dp for a 4-Inch device, but I want it to scale to bigger pixels depending on the size of the display

enter image description here


Solution

  • Fixed this by using constrain layout and setting image width and height to 0dp which makes it scale according to the image source size.