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 |
Tags
- Gradle
- boj
- Codeforces
- relay
- Coroutines
- GitHub
- 코루틴
- MiTweet
- android
- 쿠링
- 암호학
- architecture
- activity
- Kotlin
- 프로그래머스
- textfield
- livedata
- androidStudio
- MyVoca
- AWS
- pandas
- 코드포스
- Coroutine
- Compose
- TEST
- Hilt
- ProGuard
- Rxjava
- Python
- 백준
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