Reputation: 86747
How can I make use of android.grapics.color
constants?
http://developer.android.com/reference/android/graphics/Color.html
This does not work:
android:drawable="@android:color/cyan"
Upvotes: 0
Views: 297
Reputation: 38168
android.R.provides these colors.
If you want to use the Color class, you need some java code :
view.setBackgroundColor( Color.CYAN );
Upvotes: 3
Reputation: 519
Why are you setting a color to android:drawable. Are you trying to set a background? Because then you'd use:
android:background="@android:color/black"
Although in my editor I don't see cyan as an option. If you just cntrl+space in the xml field, you can pick @android:color/ and then pick a color. You can always make your own in the colors.xml file though :)
Upvotes: 0