반응형
Notice
Recent Posts
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- 워치
- TIZEN
- 오즈뷰어
- socket-server
- OZViewer
- ozd
- git-push
- firebase-storage
- hung-up
- Java8
- JNI
- Kotlin
- NoSuchMethodError
- AWS
- Flavors
- git
- Dva
- Android
- socket-client
- Firebase
- google-login
- socket.io
- BottomSheetDialog
- mqtt
- cloud-firestore
- ActivityResult-API
- firebase-database
- gradle
- mosquitto
- Galaxy Watch
Archives
- Today
- Total
Hyeyeon blog
[Android] RecyclerView의 LayoutManager를 지정하는 방법 본문
반응형
1. LinearLayoutManager
1-1. 코드에서 지정
layoutManager = LinearLayoutManager(context)
1-2. xml에서 지정
<androidx.recyclerview.widget.RecyclerView
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:orientation="vertical" />
2. GridLayoutManager
2-1. 코드에서 지정
layoutManager = GridLayoutManager(view.context, 2 /* 열 갯수 */)
2-2. xml에서 지정
<androidx.recyclerview.widget.RecyclerView
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2"
android:orientation="vertical" />
728x90
'개발 > Android' 카테고리의 다른 글
[Android] TextView 일부 내용에 색상 넣기 (0) | 2019.08.07 |
---|---|
[Android] 비밀번호 정규식 (0) | 2019.07.23 |
[Android] Scroll 최상단, 최하단 shadow 삭제 (0) | 2019.06.22 |
[Android] databinding으로 1000단위 콤마(,) 표시 (0) | 2019.06.22 |
[Android] MotionLayout (0) | 2019.03.21 |
Comments