이번 시간에는 안드로이드 스튜디오에서
업데이트를 했더니 버튼이 보라색으로
고정되어 있는 상황을 해결하는 방법을
알아보겠습니다.
첫 번째 방법은 테마를 변경해서 해결하는 방법입니다.
res -> values -> thtmes -> themes.xml
해당 파일에 가보면 style태그 속성 parent값에 Theme.MaterialComponents 형식의 값이
들어가 있을 것입니다. 이 값을 Theme.AppCompat로 시작하는 값으로 변경하면
예전처럼 버튼색이 회색빛으로 돌아올 것입니다.
<style name="Theme.MaterialExam" parent="Theme.AppCompat.DayNight.DarkActionBar">
두 번째 방법은 xml파일 안에서 직접 바꾸는 방법을 알아보겠습니다.
Button태그를 쓰면 테마 속성의 값을 가져오기 때문에 보라색이 되는 것입니다.
근데 메테리얼(Material) 디자인을 쓰면서 버튼은 다른 색을 써야겠다면
1. Button태그 대신 androidx.appcompat.widget.AppCompatButton을 쓴다.
2. 속성의 background 대신 backgroundTint속성에 원하는 색상을 넣는다.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
tools:context=".MainActivity">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="버튼" />
<androidx.appcompat.widget.AppCompatButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="버튼" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:backgroundTint="@android:color/darker_gray"
android:text="버튼"/>
</LinearLayout>
2022.03.02 - [안드로이드] - [안드로이드] SQLite RecyclerView 연락처 만드는 방법 part1 - 조회
[안드로이드] SQLite RecyclerView 연락처 만드는 방법 part1 - 조회
앞으로 SQLite, RecyclerView를 통해서 연락처 만드는 방법을 알아보겠습니다. 내용이 많다 보니 조회, 등록, 수정, 삭제 별로 나눠 올리겠습니다. 이번에는 조회 부분입니다. 목차 1. 실행 화면 2. 연락
aries574.tistory.com
2022.03.03 - [안드로이드] - [안드로이드] SQLite RecyclerView 연락처 만드는 방법 part2 - 등록
[안드로이드] SQLite RecyclerView 연락처 만드는 방법 part2 - 등록
이번 시간에는 이전에 이어서 연락처 등록하는 방법을 알아보겠습니다. 이전 포스팅을 먼저 보고 오시면 됩니다. 2022.03.02 - [안드로이드] - [안드로이드] SQLite RecyclerView 연락처 만드는 방법 part1 -
aries574.tistory.com
2022.03.04 - [안드로이드] - [안드로이드] SQLite RecyclerView 연락처 만드는 방법 part3 - 상세
[안드로이드] SQLite RecyclerView 연락처 만드는 방법 part3 - 상세
이번 시간에는 이전에 이어서 연락처 상세화면 만드는 방법을 알아보겠습니다. 이전 포스팅을 먼저 보시고 오시면 됩니다. 2022.03.02 - [안드로이드] - [안드로이드] SQLite RecyclerView 연락처 만드는
aries574.tistory.com
2022.03.05 - [안드로이드] - [안드로이드] SQLite RecyclerView 연락처 만드는 방법 part4 - 수정
[안드로이드] SQLite RecyclerView 연락처 만드는 방법 part4 - 수정
이번 시간에는 이전에 이어서 연락처 수정하는 방법을 알아보겠습니다. 이전 포스팅을 먼저 보시고 오시면 됩니다. 2022.03.02 - [안드로이드] - [안드로이드] SQLite RecyclerView 연락처 만드는 방법 part
aries574.tistory.com
2022.03.06 - [안드로이드] - [안드로이드] SQLite RecyclerView 연락처 만드는 방법 part 5 - 삭제
[안드로이드] SQLite RecyclerView 연락처 만드는 방법 part5 - 삭제
이번 시간에는 이전에 이어서 연락처 삭제하는 방법에 대하여 알아보겠습니다. 이전 포스팅을 먼저 보시고 오시면 됩니다. 2022.03.02 - [안드로이드] - [안드로이드] SQLite RecyclerView 연락처 만드는
aries574.tistory.com
[안드로이드] Firebase 시작하기 실시간 데이터베이스 Realtime Database (간단한 데이터 읽기, 쓰기) part1 (0) | 2022.03.09 |
---|---|
[안드로이드] 달력 (DatePicker) 버튼(Button) 으로 호출하는 방법 (0) | 2022.03.08 |
[안드로이드] SQLite RecyclerView 연락처 만드는 방법 part5 - 삭제 (0) | 2022.03.06 |
[안드로이드] SQLite RecyclerView 연락처 만드는 방법 part4 - 수정 (0) | 2022.03.05 |
[안드로이드] SQLite RecyclerView 연락처 만드는 방법 part3 - 상세 (0) | 2022.03.04 |
댓글 영역