आप आईडी के साथ अपने main.xml में एक बटन है, तो = Button1 तो आप यह इस प्रकार के रूप में उपयोग कर सकते हैं:
setContentView(R.layout.main);
Button mButton=(Button)findViewById(R.id.button1);
mButton.setTextColor(Color.parseColor("#FF0000")); // custom color
//mButton.setTextColor(Color.RED); // use default color
mButton.setBackgroundResource(R.drawable.button_shape);
R.drawable.button_shape (button_shape.xml):
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#70ffffff"
android:centerColor="#70ffffff"
android:endColor="#70ffffff"
android:angle="270" />
<corners
android:bottomRightRadius="8dp"
android:bottomLeftRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp"/>
</shape>
आप अपनी खुद की आकृति फ़ाइल कर सकते हैं। इसे अपनी जरूरत के हिसाब से बदलें।
saerch अतः http://stackoverflow.com/questions/4755871/how-to-set-image-button-backgroundimage- के लिए-अलग राज्य/4755934 # 4755934 – ingsaurabh