【发布时间】:2020-01-03 11:37:33
【问题描述】:
我正在尝试使用 AndroidX 库实现滑动刷新功能:androidx.swiperefreshlayout.widget.SwipeRefreshLayout
我的应用正在使用 Android 数据绑定,因此我想使用可观察字段来控制此小部件的状态。
过去我使用过AppCompat one - 它已经被弃用了。
以前,我可以通过以下方式访问字段:
<android.support.v4.widget.SwipeRefreshLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:refreshing="@{viewModel.isLoading}">
...
// My RecyclerView here
</android.support.v4.widget.SwipeRefreshLayout>
但是,这似乎不再适用 - 与 AndroidX 等效。 我错过了什么吗?或者是否有任何解决方案/解决方法来实现这一目标?
我的项目已经完全迁移到 AndroidX,没有错误或冲突的依赖项。
【问题讨论】:
-
您在使用 android x 相当于 swiperefreshlayout 时遇到什么问题?
-
@Kushal 我无权访问应用程序:在 SwipeRefreshLayout 中刷新。
标签: android data-binding android-databinding androidx swiperefreshlayout