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
You should also check if there is any padding set around your imageButton, I created one that looked very similar to use and although fitXY worked, changing the size of the image became very confusing error-prone. However I then realized that there was 100p padding around all of the image hence the border being 100 dp away at each edge of the image.