버튼이 있습니다. 버튼을 누를 때 텍스트를 굵게 표시해야합니다. 그래서 나는 대담하고 정상적인 스타일을 썼습니다.
<style name="textbold" parent="@android:style/TextAppearance">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textStyle">bold</item>
</style>
<style name="textregular" parent="@android:style/TextAppearance">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textStyle">normal</item>
</style>
이제 button_states.xml이 다음과 같습니다.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="true"
style="@style/textbold" />
<item android:state_focused="false" android:state_pressed="true"
style="@style/textregular" />
<item style="@style/textregular" />
</selector>
이 버튼의 레이아웃에서 배경도 투명하게 만들어야합니다 ... 어떻게합니까? 내 레이아웃 코드는 다음과 같습니다
<Button android:id="@+id/Btn" android:background="@drawable/button_states" />
스타일에 배경을 투명하게 포함 시키려면 어떻게해야합니까?