I am trying to fit an image inside an ImageButton for testing but the way the ImageButtonbehaves is not as expected.
initially, I made a
On activity Creat..you can get the screen resolution...and resize the image according to the screen Widht and Height..and set the image ..In this way your ratio will be same on every type of devices ..
to resize images..: 1. Get screen width and height 2.resize image acording to screen resolution 3.set Image to the view