圆形imageview之CircleImageView

    xiaoxiao2021-12-14  24

    简单实现圆形图片显示

    效果图:

    首先添加gradle

    compile 'de.hdodenhof:circleimageview:+' 然后在布局文件里添加:

    <de.hdodenhof.circleimageview.CircleImageView android:id="@+id/item2_img" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="5dp" app:civ_border_width="2dp" android:src="@drawable/iocn1" app:civ_border_color="#ff0000" /> <!--app:civ_border_width="2dp"圆形边框 app:civ_border_color="#FF000000"边框颜色 --> 填充的时候可以用Picasso框架填充

    Picasso.with(context).load(data.get(position).getCommodityIcon()).into(houdle.img); 详情可以参考

    https://my.oschina.net/u/1046838/blog/405460

    http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0806/3268.html

    https://github.com/hdodenhof/CircleImageView

    转载请注明原文地址: https://ju.6miu.com/read-971940.html

    最新回复(0)