res/layout/activity_main.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:background="@color/Blue">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</RelativeLayout>
meanwhile, res/values/colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="Blue">#0000FF</color>
</resources>
as you can see, the color does start with #
The code is exactly as you see it.
Use app:drawableTint="@color/yourColor" in the xml instade android:drawableTint="@color/yourColor" .
I have to go to File-->Invalidate Cache/Restart.
It amazes me that this bug still hasn't been fixed in Android Studio, searching on SO it looks like it has plagued other people in different ways.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With