CircleImageView的介绍:
这是一个成熟的、以圆形方式展现图片的库-CircleImageView
github地址:https://github.com/hdodenhof/CircleImageView
在gradle中
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'de.hdodenhof:circleimageview:2.0.0' }
在***.xml中的layout布局:
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/profile_image" android:layout_width="96dp" android:layout_height="96dp" app:civ_border_width="2dp" android:src="@mipmap/touxiang" app:civ_border_color="#ffffff"/> </LinearLayout>
然后运行程序,就可以出现圆形的图片了。