kotlin 에서 화면 아래로 Pull Swipe 시에 새로고침 구현 - SwipeRefreshLayout > 개발

본문 바로가기
사이트 내 전체검색

개발

kotlin 에서 화면 아래로 Pull Swipe 시에 새로고침 구현 - SwipeRefreshLayout

페이지 정보

profile_image
작성자 관리자 (112.♡.173.204)
댓글 0건 조회 2,968회 작성일 21-05-06 21:05

본문

## build.gradle

아래 처럼 추가한다.
```
dependencies {
    // ...
    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
}
```
https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout?hl=ko



## activity_main.xml

xml 코드를 아래처럼 refresh 할 것을 감싸고 작성한다.
```
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/swipeContainer"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

  <androidx.recyclerview.widget.RecyclerView
      android:id="@+id/rvItems"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true" />

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
```
https://guides.codepath.com/android/implementing-pull-to-refresh-guide



## 참고
https://guides.codepath.com/android/implementing-pull-to-refresh-guide
https://www.tutorialspoint.com/how-to-create-a-swipe-refresh-layout-in-android-using-kotlin
https://android--code.blogspot.com/2018/02/android-kotlin-swiperefreshlayout.html

추천0

댓글목록

등록된 댓글이 없습니다.

Total 392건 15 페이지
  • RSS
개발 목록
번호 제목 조회 추천 날짜
1122559002-18
1112550002-17
1102546006-30
1092520002-06
1082518004-07
1072516003-22
1062512005-28
1052505003-15
1042493006-14
1032492006-12
1022490003-28
1012476005-11
1002476004-29
992469002-08
982464006-30
972454009-27
962426006-06
952422006-22
942410002-20
932394005-01

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.