Thursday 15 March 2012

android - Failed to convert @color/Blue into a drawable when setting background color -



android - Failed to convert @color/Blue into a drawable when setting background color -

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 can see, color start #

the code see it.

i have go file-->invalidate cache/restart.

it amazes me bug still hasn't been fixed in android studio, searching on looks has plagued other people in different ways.

android

No comments:

Post a Comment