인터넷 강의에서 Theme 관련 해서 자세한 설명이 없어서 모르겠는데
아래 소스 처럼 com.google.android.material.textfield.TextInputLayout 을 사용해서 TextInput view를 만들었는데
적용이 안 되길레 Theme.xml에 Base.Theme을
Theme.AppCompat.DayNight.NoActionBar -> Theme.MaterialComponents.DayNight.NoActionBar
로 변경을 해줘야 되긴 하더라고.
아래가 적용 이미지
(테마가 검정인데 선이 검정색이라 잘 안 보이지만 검은 테투리의 TextInput 상자가 있음)
내가 사용하려는 기능이 MaterialComponents에 있는데 기본 설정을 AppCompat을 사용해서 그런거라 생각하는데...
문제는 버튼 색상이 보라색으로 고정이 됨..
내 생각에는 기본 테마를 설정을 했더라도 내가 버튼의 Background를 따로 지정을 했으면 그걸로 바껴야 정상 아님???
보통 이런건 어떻게 해결 함?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
<LinearLayout
android:id="@+id/llSelectDates"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/toolbarHistory"
android:orientation="horizontal"
android:gravity="center"
android:padding="10dp"
>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilStartDate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
app:boxStrokeColor="@color/black"
app:hintTextColor="@color/black"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_weight="2">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etStartDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilEndDate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
app:boxStrokeColor="@color/TeaGreen"
app:hintTextColor="@color/black"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_weight="2">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etEndDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
/>
</com.google.android.material.textfield.TextInputLayout>
<Button
android:id="@+id/btnSearch"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="조회"
android:textStyle="bold"
android:textSize="17sp"
android:textColor="@color/white"
android:background="@color/ButtonGreen"
/>
</LinearLayout>
|
cs |
5개의 댓글
무분별한 사용은 차단될 수 있습니다.
닉네임대충짓
그래서 나는 마테리얼거 잘 안쓰는편..
집에가게해줘
그냥 ㅅㅂ 감안 하고 쓰던가 아니면 안 쓰던가 해야 하는거야? 정말????
닉네임대충짓
ㅋㅋㅋ 지맘대론게 너무많음 마테리얼
저거 아마 android:background 말고 다른 속성 참조할텐데, 그게 뭔지 하나하나 찾아보거나
걍 딴거쓰거나..
회사에서는 대부분 디자인문서가 있기떄문에 마테리얼 쓸일이 없음
힝거루
내 기억으론 백그라운드 말고 tint인가 tintColor였던가
집에가게해줘
이거네.
android:backgorund 에서 app:backgroundTint 쓰니까 색상이 바뀌네..
그러면 배경이나 테두리 이것저것 다 material 버전의 properties를 찾아서 바꿔야 겠네?
왜 이따구로 처 만든건지 모르겠지만 뭐... 다 이유가 있었겠지?
어쨌든 고맙다 ㅜㅜ