Error while setting Gradient color in android

4105 views android
-1

I am totally new android and i dont know whats wrong with my code

I see red exclamation mark before this line android:background="@drawable/myBtnWithColor"

check the image below

enter image description here

Here is my myBtnWithColor.xml file

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
    <!--  Gradient Bg for listrow -->
   <gradient
      android:startColor="#f1f1f2"
      android:centerColor="#e7e7e8"
      android:endColor="#cfcfcf"
      android:angle="270" />
</shape>

answered question

1 Answer

7

Rename your file to mybtnwithcolor. Don't use upper-case letters in xml file names.

posted this

Have an answer?

JD

Please login first before posting an answer.