코틀린 안드로이드 스튜디오 다크모드 비활성화
2024. 1. 10. 12:42ㆍ- 안드로이드/kotlin
디바이스 기기의 설정이 다크모드로 되어 있을때 앱을 실행하면 다크모드 화면으로 변경되는데 그렇게 되면 다크모드 일때와 아닐때 두가지 모드에 맞춰 개발을 해야 합니다. 이럴때 그냥 기기 설정이 다크모드 여도 앱에서는 다크모드를 비활성화 할수가 있는데요 간단히 한줄만 변경해주면 됩니다.
res > values > themes > themes.xml (night) 파일을 수정합니다.
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.MvvmInsta" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your dark theme here. -->
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
</style>
</resources>
parent="Theme.Material3.DayNight.NoActionBar" 의 DayNight을 Light 으로 바꿔주면 다크모드가 비활성화 됩니다.
'- 안드로이드 > kotlin' 카테고리의 다른 글
의존성 주입과 hilt (0) | 2024.02.19 |
---|---|
Android kotlin jitpack로 라이브러리 사용하기 (0) | 2024.01.18 |
코틀린 retrofit2 레트로핏2 사용하기 (0) | 2024.01.04 |
코틀린 fragment 화면 전환시 이전 화면 유지하기 (0) | 2023.12.17 |
getLaunchIntentForPackage로 다른앱 실행시키기 (0) | 2023.12.06 |