1.在项目build.gradle(Module:app)中实现接口
implementation 'com.github.bumptech.glide:glide:4.11.0' 同步一下或关闭项目重新打开。
2.布局
代码:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <ImageView android:id="@+id/im" android:layout_width="match_parent"