Notice
Recent Posts
Recent Comments
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
- GitHub
- TEST
- 쿠링
- MiTweet
- boj
- AWS
- relay
- 프로그래머스
- pandas
- android
- 백준
- 코드포스
- activity
- Rxjava
- Kotlin
- Compose
- architecture
- Gradle
- Hilt
- Codeforces
- Python
- MyVoca
- 코루틴
- ProGuard
- androidStudio
- livedata
- Coroutines
- 암호학
- textfield
- Coroutine
Archives
- Today
- Total
이동식 저장소
Preview 모드인지 확인하는 방법 본문
CompositionLocal 값 중 ``LocalInspectionMode``를 참조하면 된다.
True if the composition is composed inside a Inspectable component.
사용 예시는 다음과 같다.
val isPreview = LocalInspectionMode.current
Box {
if (isPreview) {
// 이 구문은 Preview에서만 실행됨
}
// 이 구문은 항상 실행됨
}
참고자료
'Primary > Compose' 카테고리의 다른 글
| Compose에서 이미지가 흑백으로 보일 때 (0) | 2023.06.10 |
|---|---|
| 모든 터치 이벤트의 시작과 끝을 판별하는 방법 (0) | 2023.01.14 |
| Brush로 다양한 색깔 효과 입히기 (0) | 2023.01.04 |
| [Compose] LazyList에서 아이템을 추가했을 때 스크롤 위치를 기억하는 방법 (0) | 2022.12.14 |
| [Relay] Slot 구현하기 (0) | 2022.11.29 |
Comments