AngelJanniee
AngelJanniee

Reputation: 623

EditText showing black background

I have created EditText also created xml for this background like below attached code

<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item
    android:state_pressed="true"
    android:drawable="@drawable/login_editext_blue_border"/>
<item
    android:state_focused="true"
    android:drawable="@drawable/login_editext_blue_border"/>
<item
    android:drawable="@drawable/login_editext_grey_border"/>

then I have added this as background of EditText

I use this as my app theme

Theme.AppCompat.Light.DarkActionBar

Now If run my application then the EditText background showing as a black background like below image in android Galaxy S3 mini 4.1.2 enter image description here

please suggest the solution for this.

Upvotes: 1

Views: 1475

Answers (1)

Sathish Kumar J
Sathish Kumar J

Reputation: 4345

Change your drawable like,

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="schemas.android.com/apk/res/android";     android:shape="rectangle"> 
<stroke android:color="@color/colorAccent" android:width="1dp" /> 
<corners android:radius="4dp" /> 
<solid android:color="#ffffff"/>
</shape>

problem is , you need to add

<solid android:color="#ffffff"/>

to your drawable in <shape> tag.

This might helps you.

Upvotes: 5

Related Questions