Button

Android Button Highlight

In android, we can highlight the button through custom images. Here is a example that will give you about how to set a image when the button is focused, pressed and focused pressed.

Android HTML View

In android, we can use some HTML Tags for text.

Android Button Drawable

In Android, by using Android button drawable we can set text position to be below, top, right or left of the button.

Android Button Size

We can set Android button size manuallly by using the button property 'android:layout_height' & 'android:layout_width'.

Android Button Background Color

Android Button Background Color Example -

We can set the button background color by using the button property 'android:background' .

Android Widgets Button Image

Android Button Background Image Example:-

We can set the Background image for a button by using the button property 'android:background'.

Android Button Click

Today let us see an example for the Android button onclick -

[sourcecode language="java"]
<Button android:text="@+id/Button01"
android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
[/sourcecode]

Onclick Action:- Edit your Java code like this

[sourcecode language="java"]
public class SamButton extends Activity {
Private Button butexample;
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.main);
// Declaring Button
butexample =

Android- Button Transparent

Here we are going to see how to make a button transparent in Android...

[sourcecode language="css"]

<Button android:background="@android:color/transparent"
android:text="@+id/Button01"
android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff" />
[/sourcecode]

By using android:background="@android:color/transparent" the button background will become transparent

Th

Android Text Color

In Android, we can set text color for textview, edittext, buttons, etc...

Example:-

Input

Output

Syndicate content