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

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

개발

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

페이지 정보

profile_image
작성자 관리자 (112.♡.173.204)
댓글 0건 조회 2,606회 작성일 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 386건 4 페이지
  • RSS
개발 목록
번호 제목 조회 추천 날짜
3262585005-14
3252804005-11
3243604005-10
3232753005-08
3224509005-07
3212960005-07
열람중2607005-06
3197030005-06
3183117005-04
3173809005-04
3161692005-04
3151644005-04
3143187005-04
3131869005-02
3123181005-01
3112113005-01
3102050005-01
3092794004-30
3081855004-30
3073467004-30

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.