안드로이드 세계최신 버전(Android Studio 4.1.2)으로 올라오면서 버튼 백그라운드로 색상을 변경하게 되면 변경되지 않는 문제점이 발견되었다. 이전까지의 적용방법으로 적용을 해본다. 라운드 처리를 하고 버튼의 색을 빨간색, 윤곽선을 흰색으로 해보겠다. button_round.xml
activity_main.xml
이전에는 이렇게 사용하면 라운드된 버튼과 색이 변경된 것을 볼 수 있었다. 하지만 최신 버전으로 들어오게 되면 라운드 처리는 되었지만 색의 변경이 전혀 이루어지지 않은 것을 확인할 수 있다. 해결방법은 다음과 같다.
위와 같은 방법이 있다. 1번의 방법
2번의 방법
3번의 방법
3번의 경우 테마가 변경이 되었기 때문에 아래의 사진을 참고하여 내용을 수정해주면 좋다. 버튼 이슈 : github.com/material-components/material-components-android/issues/889 [Button] android:background not working · Issue #889 · material-components/material-components-android Description: after I change my app them to Theme.MaterialComponents.NoActionBar , In my xml file Button label's android:background="@drawable/login_btn_bg" not working,and I can't... github.com |