Android開源元件---CircleImageView的使用
阿新 • • 發佈:2019-01-07
CircleImageView的介紹:
這是一個成熟的、以圓形方式展現圖片的庫-CircleImageView
AndroidStudio下的使用步驟:在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>
然後執行程式,就可以出現圓形的圖片了。