https://i.stack.imgur.com/pcnxg.png {图像的图像}
如您在图片中看到的那样,手机图标中有一个灰色轮廓。我如何摆脱这种背景(灰色),只是将图像作为i con。
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/phone" />
这就是我已经拥有的。
谢谢!
尝试:
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/phone"
android:background="@null" />
imageButtons始终在它们周围具有边框,只需用imageView替换imageButton即可解决此问题。在tmagebutton上使用的所有类和方法都将在图像视图上使用,例如onclicklisteners等。
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/phone" />