【问题标题】:How can I remove white spaces around an ImageButton?如何删除 ImageButton 周围的空白?
【发布时间】:2021-06-19 11:17:54
【问题描述】:

如何去除这些 ImageButtons 周围的空白?

这是其中一个 ImageButton 的示例代码:

<ImageButton
        android:id="@+id/imageButton3"
        android:layout_width="64dp"
        android:layout_height="56dp"
        android:src="@drawable/ic_circulo"
        app:layout_constraintBottom_toTopOf="@+id/imageButton2"
        app:layout_constraintStart_toStartOf="parent" />

提前致谢。

【问题讨论】:

标签: android padding margin imagebutton android-imagebutton


【解决方案1】:

试试这个:

android:background="@null" or 
android:background="#00000000"

【讨论】:

  • 您好,感谢您的回答。但是,这会删除灰色背景,我想保留它。我可以使用android:background="#00000000" 并使用我的灰色,但它会填满所有空间。我需要的是简单地删除灰色正方形周围的空间,保持正方形和灰色的颜色。
  • 在你的 ImageButton 中尝试 android:scaleType="fitXY" 属性以及我的答案。那个箭头之类的东西应该在那里?
猜你喜欢
  • 2016-02-25
  • 2013-11-22
  • 2020-08-04
  • 2017-02-25
  • 2020-11-10
  • 1970-01-01
  • 2016-05-27
  • 2015-12-24
  • 1970-01-01
相关资源
最近更新 更多