Is it possible to make the button\'s background color like glass\'s color, on android/eclipse?..If so how? if not why?
Thanks for your time!...
Here is the solution what you are looking for.
use this xml in drawable
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="false">
<shape >
<gradient
android:startColor="#2F000000"
android:endColor="#2fDEDEDE"
android:angle="270" />
<!-- <stroke
android:width="1dp"
android:color="#bb00ff00" /> -->
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp" android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item android:state_pressed="true" >
<shape>
<gradient
android:startColor="#2F000000"
android:endColor="#2fDEDEDE"
android:angle="270" />
<!-- <stroke
android:width="1dp"
android:color="#bb00ff00" /> -->
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp" android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#2F000000"
android:endColor="#2fDEDEDE"
android:angle="180" />
<!-- <gradient
android:startColor="@color/cream_dark"
android:endColor="@color/cream"
android:angle="270"/> -->
<!-- <stroke
android:width="1dp"
android:color="#ffffffff" /> -->
<corners
android:bottomRightRadius="3dp"
android:bottomLeftRadius="3dp"
android:topLeftRadius="3dp"
android:topRightRadius="3dp"/>
<padding
android:left="10dp"
android:top="10dp" android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
</selector>
usage
<Button android:id="@+id/text1"
android:layout_marginTop="200dp"
android:layout_width="fill_parent"
android:gravity="center"
android:textColor="#FF1414"
android:background="@drawable/btn_darkblue"=========>this is the button background
android:text="Ram kiran"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:textSize="15dp"
android:layout_height="60dp"
/>
It will looks like
I'm agree with Cata,but also you can use shapes or use semi transparent colors if these help you.You can see some primary details in about shapes in vogella.com or betaful.com
Try to do this setting transparent background to button as
android:background="@android:color/transparent"