Android 移除填充图像按钮
我正在使用ImageButton,无法删除图像和按钮边框之间的填充或空格。我怎样才能做到这一点 这是我的布局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
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”