Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/204.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 移除填充图像按钮_Android - Fatal编程技术网

Android 移除填充图像按钮

Android 移除填充图像按钮,android,Android,我正在使用ImageButton,无法删除图像和按钮边框之间的填充或空格。我怎样才能做到这一点 这是我的布局 <ImageButton android:id="@+id/imageButton" style="?attr/selectableItemBackgroundBorderless" android:layout_width="103dp" android:layout_height="110dp" android:layout_marginLeft="8dp" and

我正在使用ImageButton,无法删除图像和按钮边框之间的填充或空格。我怎样才能做到这一点

这是我的布局

<ImageButton
 android:id="@+id/imageButton"
 style="?attr/selectableItemBackgroundBorderless"
 android:layout_width="103dp"
 android:layout_height="110dp"
 android:layout_marginLeft="8dp"
 android:layout_weight="1"
 android:paddingBottom="-15dp"
 android:paddingTop="30dp"
 android:scaleType="fitCenter"
 app:srcCompat="@drawable/com_facebook_profile_picture_blank_square" />


非常感谢

试试这个!我可以为你工作

android:scaleType="centercrop"

多谢各位!这就是我的解决方案:

<ImageButton
android:id="@+id/imageButton"
style="?attr/selectableItemBackgroundBorderless"
android:layout_width="103dp"
android:layout_height="110dp"
android:layout_marginLeft="8dp"
android:paddingBottom="0dp"
android:paddingTop="50dp"
android:scaleType="fitCenter"
app:srcCompat="@mipmap/ic_launcher"
 />


我将padding bottom设置为0

为什么不使用带有RelativeLayout的ImageView作为父对象?通过这种方式,您可以在ImageView中设置android:layout\u alignParentBottom=“true”,所有内容“应该”都可以正常工作。您是否可以至少从ImageButton家长处发布完整的xml(即)呢?非常感谢!这就是我的解决方案:
android:paddingBottom=“0dp”