| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- activity
- Coroutines
- textfield
- boj
- Codeforces
- MyVoca
- Python
- Compose
- Coroutine
- 프로그래머스
- relay
- android
- Gradle
- MiTweet
- Rxjava
- 암호학
- livedata
- 쿠링
- 백준
- 코드포스
- architecture
- TEST
- GitHub
- Hilt
- androidStudio
- ProGuard
- Kotlin
- pandas
- 코루틴
- AWS
- Today
- Total
목록LazyList (2)
이동식 저장소
``LazyColumn``에서 리스트 앞에 아이템을 추가하면 스크롤 위치가 위로 올라가 버린다. 스크롤 위치를 기억하고 싶다면 아이템의 ``key``를 설정해야 한다. 공식 문서에는 다음과 같이 적혀 있다. When you specify the key the scroll position will be maintained based on the key, which means if you add/remove items before the current visible item the item with the given key will be kept as the first visible one. 당연히 key는 유일해야 한다. 가장 쉬운 구현 방법은 아마도 ``hashCode()``일 것이다. val items..
``LazyList`` 계열 composable인 ``LazyColumn``과 ``LazyRow``에는 ``contentPadding``이라는 매개변수가 있다. 일반적인 ``Modifier.padding()``과 어떻게 다른지 알아보자. @Composable @ComposableTarget public fun LazyColumn( modifier: Modifier, state: LazyListState, contentPadding: PaddingValues, reverseLayout: Boolean, verticalArrangement: Arrangement.Vertical, horizontalAlignment: Alignment.Horizontal, flingBehavior: FlingBehavior,..