如图效果
代码撸起:
RequestOptions options1 = new RequestOptions();
//必须加到List里,否则冲突
List<Transformation> list = new ArrayList<>();
list.add(new BlurTransformation(25,3));
list.add(new CenterCrop());
MultiTransformation multiTransformation = new MultiTransformation(list);
options1.transform(multiTransformation);
RequestOptions options2 = RequestOptions.circleCropTransform();
Glide.with(this).load(R.mipmap.hehe).apply(options1).into(iv_blur);
Glide.with(this).load(R.mipmap.hehe).apply(options2).into(personImg);
xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView android:id="@+id/outsideImg"
android:layout_width="match_parent"
android:layout_height="200dp" />
<ImageView
android:id="@+id/personImg"
android:layout_width="100dp"
android:layout_centerInParent="true"
android:layout_height="100dp" />
</RelativeLayout>
······
</LinearLayout>
大功告成!!!
网友评论