I am new to Android development and I want to learn how to style a button element. i am familiar with styling in HTML (CSS and HTML styling). For example How can I translate and implement this css styling into Android (I assume XML styling):
.buttonClass{
background-color: #fff;
color: #000;
border-radius: 10px;
opacity: 0.5
...
}
I have this button element code the Graphical Layout created for me on Eclipse:
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Camera" />
You can do this like this:
for background color:
if you want to have a rounded button:
The “myBtnWithColor” XML file:
You can set the opacity of the Button in your Backgroundcolor. As mentioned you can set alpha values in your colors.