gile可以加載處圓角或圓形頭像

// 動畫 zoom_in

<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:fillAfter="true">

    <scale
        android:duration="@android:integer/config_longAnimTime"
        android:fromXScale="0.1"
        android:fromYScale="0.1"
        android:pivotX="30%"
        android:pivotY="30%"
        android:toXScale="1.0"
        android:toYScale="1.0"/>
</set>


glide裁切圓角頭像
Glide.with(this)
                .load(R.mipmap.ic_launcher)
                .animate(R.anim.zoom_in) 
                .error(R.mipmap.ic_launcher)
                .into(image);
        //圓形裁剪
        Glide.with(this)
                .load(R.mipmap.ic_launcher)
                .bitmapTransform(new CropCircleTransformation(this))
                .into(image2);
        // //圓角處理
        Glide.with(this)
                .load(R.mipmap.ic_launcher)
                .bitmapTransform(new GrayscaleTransformation(this))//帶灰色蒙層
                .bitmapTransform(new RoundedCornersTransformation(this, 30, 0, RoundedCornersTransformation.CornerType.ALL))
                .into(image3);


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章