Glide transform CircleCrop()圆图,Kotlin
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)
}
}