Search code examples
androidxmlandroid-layoutscaleimagebutton

How can I increase the size of the images within my ImageButtons?


In a nutshell I'm looking for my dotted box image to fill the view. I had 60x60 image Buttons in my medium screen layout. In my large screen layout my buttons have appeared tiny so I've increased them to 100x100. The images within these buttons will not stretch. Is it possible to stretch these images or replace them with bigger ones?

enter image description here


Solution

  • This combined with specifiying your own dimensions rather than wrap_content does the job.

    android:scaleType="fitXY"