Issue
"@color/rippleEffectColor" Error in Red
App>Res>Values>Colors.xml - I have created color for RippleEffectColor
<resources>
<Color name="rippleEffectColor">#F816A463</Color>
</resources>
App>Res>Drawable
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
**android:color="@color/rippleEffectColor"**
tools:targetApi="lollipop"
>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/btnSignIn"></solid>
<stroke android:color="color/btnSignIn" android:width="2dp"></stroke>
<corners android:radius="2dp"/>
</shape>
</item>
</ripple>
But I keep having an error on android:color="@color/rippleEffectColor"
Solution
You have two typos in your code. I ran it like this, it's working:
<resources>
// color has to be lower case
<color name="rippleEffectColor">#F816A463</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:color="@color/rippleEffectColor"
tools:targetApi="lollipop"
>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/btnSignIn"></solid>
//The @ sign was missing before color
<stroke android:color="@color/btnSignIn" android:width="2dp"></stroke>
<corners android:radius="2dp"/>
</shape>
</item>
</ripple>
Answered By - einUsername
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.