Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to give blue outline to edit text android?

Tags:

android

i have an edit text view , i want its border to be of blue color , only its border or outline to be blue not the complete edit text view .How to get blue border?Please help

like image 513
vaibvorld Avatar asked Oct 12 '12 19:10

vaibvorld


1 Answers

You can use a shape drawable as a background for the edit text view. You can define it in an xml file in the res/drawable folder:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@android:color/transparent" />
    <stroke
        android:width="1dp"
        android:color="#0000ff" />
</shape>

If you want to make the background variable depending on whether the edit text view has focus, etc., you can use the above as one element of a state list drawable.

like image 131
Ted Hopp Avatar answered Nov 10 '22 00:11

Ted Hopp