728x90
반응형
이번에는 안드로이드 개발을 하다 보면 다크 모드가 자동으로 지원돼서 프로젝트가 생성이 된다.
다크 모드를 지원하지 않으려면 아래처럼 따라 하면 된다.
# 해결방법

res -> values -> themes -> themes.xml(night) 파일을 수정하면 된다.
수정 전 코드
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.DataBinding_EX" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
● ● ●
</style>
</resources>
수정 후 코드
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.DataBinding_EX" parent="Theme.MaterialComponents.Light.DarkActionBar">
● ● ●
</style>
</resources>
Theme.MaterialComponents.DayNight.DarkActionBar 에서 DayNight를 Light로 바꿔준다.
앱을 빌드 하면 다크 모드와 상관없이 Light 모드로 앱이 실행이 된다.
참고 자료
https://es1015.tistory.com/453
https://hanyeop.tistory.com/194
반응형
'소소한 개발 꿀팁' 카테고리의 다른 글
안드로이드 스튜디오 로그캣(Logcat) 이전 버전으로 돌아가기(돌핀 이전) (0) | 2022.11.27 |
---|---|
[Android] getAdapterPosition() Deprecated 해결 방법 (0) | 2022.08.20 |
프래그먼트 안에서 Activity,context 가져오기 (0) | 2022.03.30 |
[Android]안드로이드 프래그먼트 종료(finish) 시키기 (0) | 2022.03.02 |
다른 액티비티에서 특정 액티비티 종료하기 (0) | 2022.01.05 |