I am trying to resize(shrink) imagebutton in .xaml file in xamarin android, but i am getting imagbutton being cut in both top and bottom.Can anyone suggest me how could i shrink image to required size without any cut in image.
i am using visual studio 2015 tool to build android in xamarin
below is my code
<?xml version="1.0" encoding="utf-8"?>
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/myButton"
android:layout_width="120dip"
android:layout_height="150dip"
android:layout_marginTop="50dip"
android:layout_marginLeft="50dip"
android:padding="100dip"
android:src="@drawable/geocursor_pressed" />
EDITED ANSWER:
these extra 3 things should be added
android:adjustViewBounds="true"
android:padding="10dp"
android:scaleType="fitCenter"
By changing padding you can get desired fit of image in button
Refer Link for more information :