SwipeRefreshLayout 下拉刷新
2024-09-05 18:11:37
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.realm.RealmDemo"> <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:id="@+id/swipe_refresh_layout"> <androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent" android:id="@+id/recycle_view"/> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.constraintlayout.widget.ConstraintLayout>
使用比较简单 这里就模拟了一下加载效果 下拉触发加载显示动画此时isRefreshing=true 加载数据后需要修改为false 隐藏动画
swipe_refresh_layout.isRefreshing = false
swipe_refresh_layout.setOnRefreshListener {
Handler().postDelayed({
swipe_refresh_layout.isRefreshing = false
},2000)
}
最新文章
- Android Duplicate files copied in APK
- Service and controller in angularJs
- vs 2015 连接不上tfs 错误代码:TF31002
- centos编译安装apache
- .frame类库简单介绍与使用
- XML解析之DOM详解及与SAX解析方法的比较
- 从range和xrange的性能对比到yield关键字(中)
- [SAP ABAP开发技术总结]IDoc
- JQuery中操作Css样式
- Intellij IDEA 使用Spring-boot-devTools无效解决办法
- CODEVS 1001 舒适的路线
- java中关于json传图片的方法
- Python 基础篇:编码、变量、模块
- SWT的TableVierer的使用二(数据排序)
- [已解决]import pymssql ImportError: libsybdb.so.5
- loj#2353. 「NOI2007」 货币兑换 斜率优化
- 2018.07.07 BZOJ2212: Poi2011Tree Rotations(线段树合并)
- 【CF739E】Gosha is hunting(动态规划,凸优化)
- js入门介绍
- [GO]多任务的资源竞争问题
热门文章
- 2018CCPC吉林赛区 hdu6555~hdu6566
- JS-语句三
- vue select框change事件
- Java中Scanner类在nextInt()后无法输入nextLine()的问题
- 2018.11.16javascript课上随笔(DOM)
- 简单的Vue计算属性
- maven打包 invalid entry size Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.14.RELEASE:repackage (default) on project
- Ubuntu apt install 下载软件很慢的解决办法
- MyBatis学习——动态SQL
- R语言 批量下载财务报表