Glide transform CircleCrop()圆图,Kotlin
import android.os.Bundle
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import com.bumptech.glide.load.resource.bitmap.CircleCrop
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val imageView = findViewById<ImageView>(R.id.image)
GlideApp.with(this)
.load(R.mipmap.pic2)
.transform(CircleCrop())
.override(600, 600)
.into(imageView)
}
}
Android标准Glide加载圆形图和圆角矩形图_android glide加载圆角-CSDN博客文章浏览阅读1.2w次。引入: implementation 'com.github.bumptech.glide:glide:4.9.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'https://blog.csdn.net/zhangphil/article/details/89336265