-
버튼 색상이 보라색으로 고정 되어서 다른색으로 변경되지 않을 때안드로이드(kotlin)/UI 2022. 8. 23. 11:13
커스텀 다이얼로그를 하나 만드는데 버튼의 색상이 보라색으로 고정되어서 변경되지 않았습니다.
변경 전 이미지 <Button android:id="@+id/okBtn" android:layout_width="150dp" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:background="@drawable/white_radius_10_rectangle" android:text="@string/confirm" android:textSize="18sp" android:layout_gravity="center"/>
background 를 지정했음에도 버튼 배경색이 보라색으로만 보이는 문제가 있네요.
왜 안되나 찾아보니 themes.xml 에서 style 적용한 것 안에 parent 가 Theme.MaterialComponents.DayNight.NoActionBar 로 되어있는데 MaterialComponents 때문에 변경되지 않았습니다.
해당 부분을 AppCompat 으로 변경하니까 이상없이 나타나네요.
변경 후 이미지 버튼 배경 색상을 변경해야하는 분들은 MaterialComponents 부분을 수정해보시면 될 것 같습니다.
'안드로이드(kotlin) > UI' 카테고리의 다른 글
[안드로이드 kotlin] webview 에 팝업 나타나게 하기 (0) 2022.09.19 [안드로이드 kotlin] 안드로이드 스튜디오 xml 디자인에서만 보이게 하기 (0) 2021.05.17 [android - kotlin] 색상 표현 방법 (0) 2021.01.02