0

I am using the Xamarin Studio. I have a problem when I try to use an ImageButton. The problem is that whatever image I use it doesn't fit with the button. The image is too big or too small. Even if I try to resize the button, the image doesn't stretch to be at the same size with the button.

Quality Catalyst
  • 6,152
  • 7
  • 35
  • 60
user3765498
  • 101
  • 3
  • 7

2 Answers2

0

Couple of questions to start with - which version of Xam.Android are you using (stable, beta, alpha) and can you post the code you're currently using?

This solution may help you in any case : Fit Image in ImageButton in Android

Community
  • 1
  • 1
Nodoid
  • 1,255
  • 1
  • 22
  • 39
0

If you need the image to stretch use scaleType attribute with fitXY like so: try different settings from the visual designer to see the effects

<ImageButton
    android:src="@android:drawable/someDrawable"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/imageButton1"
    android:scaleType="fitXY" />
Alex.F
  • 4,775
  • 2
  • 32
  • 60