Android - 找不到 SwipeRefreshLayout 导入

标签 android android-layout

我正在尝试实现新的 RefreshLayout 小部件,但我的 eclipse 似乎无法识别我需要设置的导入。我使用本指南开始:Swipe to refresh GUIDE

这就是一切的开始:Android dev - Swipe to refresh

我的第一个猜测是我需要以某种方式更新我的项目以获得最新的 android API?我以前从未这样做过,我什至不知道这可能。

如果有人能引导我朝着正确的方向解决这个问题,那就太好了。

导入行:

import android.support.v4.widget.SwipeRefreshLayout;

list :

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="19" />

将库更新到最新版本后,仍然无法识别导入。

最佳答案

如果您使用的是 Material 库版本 1.2.0(如 com.google.android.material:material:1.2.0-alpha03),那么您还必须导入滑动刷新布局库。

   implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'

关于Android - 找不到 SwipeRefreshLayout 导入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22845394/

相关文章:

android - Geocoder.getFromLocationName() 在 ICS 设备中不工作

android - 电源按钮中断时无法暂停声音

java - Android 应用程序在我的 Activity 中找不到按钮处理程序的方法,导致应用程序在手机上崩溃

android - 如何从 GCM 获取注册 ID

java - 如何准确地设置一个十进制值为 float 的搜索栏进度?

android - Rio 字段绑定(bind) : LINQ interface not supporterd error on Datetime in LINQ comparison?

android - 试图了解 ScrollView 内 LinearLayout 的边距

表格中的android文本被截断

java - 无法对基本类型 int 调用 findViewById(int)

java - RecyclerView 中的 CardView 垂直滚动