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

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

개발

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

페이지 정보

profile_image
작성자 관리자 (112.♡.173.204)
댓글 0건 조회 2,676회 작성일 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
개발 목록
번호 제목 조회 추천 날짜
3262647005-14
3252858005-11
3243670005-10
3232824005-08
3224589005-07
3213015005-07
열람중2677005-06
3197133005-06
3183222005-04
3173919005-04
3161748005-04
3151705005-04
3143296005-04
3131933005-02
3123277005-01
3112170005-01
3102122005-01
3092835004-30
3081915004-30
3073549004-30

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.