Android Tutorials - How to Change the Font Color and Background color of a Textview in Android


How to Change The Font Color and Background Color of a TextView in android:-

The Android Framework permit to change the font color, background color, border color of any control by specifying some properties into layout XML files.

I am giving a code snippet which is surely helpful for you for changing the color.



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/bg"
     >

<EditText 
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:hint="Enter Password" android:password="true"
        android:id="@+id/userPass" 
        android:textColor="#FFFFFF" android:background="#FFFFAA"/>       
        />
</LinearLayout>

Note-The Color name should be in Hexadecimal form 

{ 1 comments... read them below or add one }

Admin said...

Which type of images?
background images??

Post a Comment