圆角Imageview--RoundedImageView

来源:互联网 发布:速卖通软件 编辑:程序博客网 时间:2024/06/10 02:38

github地址:https://github.com/vinc3m1/RoundedImageView

<com.makeramen.roundedimageview.RoundedImageView    android:layout_width="match_parent"    android:layout_height="match_parent"    android:layout_margin="20dp"    android:id="@+id/ivtest"    app:riv_oval="true"  是否显示椭圆,否则只有四个角有圆角    app:riv_corner_radius="200dp"    app:riv_border_width="2dip"  边框宽度    app:riv_border_color="#333333"   />

结合picasso一起使用:

ImageView ivTest = (ImageView) findViewById(R.id.ivtest);Transformation transformation = new RoundedTransformationBuilder()        .borderColor(Color.BLACK)        .borderWidthDp(3)        .cornerRadiusDp(30)        .oval(false)        .build();Picasso.with(this)        .load("http://img.pconline.com.cn/images/upload/upc/tx/wallpaper/1402/12/c1/31189058_1392186616852.jpg")        .transform(transformation)        .into(ivTest);

0 0
原创粉丝点击