如何在Android Studio中删除imageView的边框?

时间:2015-06-29 19:04:09

标签: java android imageview

我尝试将android:adjustViewBounds =“true”添加到我的图片中,但它没有做任何事情。我怎么能越过边界?我的图片是一个图标512x512。

<ImageView android:id="@+id/imageView" android:background="@drawable/needle" android:layout_below="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" /> Here is what I have now. This is the icon. This is the issue I'm facing.

1 个答案:

答案 0 :(得分:2)

使用android:background="@drawable/needle"而不是android:src="@drawable/needle"用于您的图片。 android:background="@drawable/needle"用于设置要在imageview上显示的图像背后 。编辑:OP希望使线从视图的左侧延伸到右侧。将layout_width="wrap_content"更改为layout_width="match_parent"应该可以解决问题。

相关问题