Fresco框架的好处不多说!!!
今天就用Fresco写一个圆形图片.
第一步:
-
<com.facebook.drawee.view.SimpleDraweeView android:id="@+id/img_head_hot_text" android:layout_width="60dp" android:layout_height="60dp" fresco:roundAsCircle="true"//设置圆形图片 fresco:roundedCornerRadius="20dp" />
使用:facebook自己的表签..
第二步:
-
SimpleDraweeView simpleDraweeView = view.findViewById(R.id.img_head_hot_text); simpleDraweeView.setImageURI("http://cdn.duitang.com/uploads/item/201501/05/20150105094205_tkBQd.jpeg");
找控件,进行设值....
运行的结果:没有想要的效果...图片是原来的样子..
注意:如果没有圆形图的效果看看:xml文件中引用空间是不是
xmlns:fresco="http://schemas.android.com/apk/res-auto"它,如果不是请修改!!!!