在Android中,可以通过使用ImageView的Background属性来为ImageView设置圆角。
以下是一个示例代码来实现ImageView圆角的效果:
<ImageView android:id="@+id/image" android:layout_width="100dp" android:layout_height="100dp" android:background="@drawable/circle_background" android:src="https://www.mykuaidi.com/static/image/lazy.gif" class="lazy" original="https://www.mykuaidi.com/static/image/nopic320.png" android:scaleType="centerCrop" />然后在drawable文件夹中创建一个circle_background.xml文件,内容如下:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="50dp" /></shape>这样就可以实现ImageView圆角的效果,其中android:radius属性的值可以根据需要进行调整。




