android导入android.support.v4.widget.DrawerLayout和android.support.v4.view.GravityCompat和widget.Swipe报错

解决方法:
import android.support.v4.widget.DrawerLayout;
=》import androidx.drawerlayout.widget.DrawerLayout;
import android.support.v4.view.GravityCompat;
=》import androidx.core.view.GravityCompat;
import android.support.v4.widget.SwipeRefreshLayout;
=》先在app的build.gradle里导入依赖
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
然后在类里导入
import androidx.swiperefreshlayout.widget.*;

import android.support.v4.app.FragmentActivity;

=》在project Struct里搜support-v4导入依赖即可

给个官网地址吧,可以自己搜找不到的类

Fragment  |  Android 开发者  |  Android Developers

你可能感兴趣的:(android,android,android,studio,ide)