আমার একটি বোতাম আছে আমি বোতামটি টিপলে আমাকে পাঠ্যকে অন্যথায় স্বাভাবিক হিসাবে বোল্ড করতে হবে। তাই আমি গা bold় এবং সাধারণ জন্য স্টাইল লিখেছি।
<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>
এখন আমার কাছে একটি বাটন_স্টেট.এক্সএমএল রয়েছে:
<?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" />
আমি কীভাবে আমার শৈলীতে স্বচ্ছ হিসাবে পটভূমি অন্তর্ভুক্ত করব?