未能@色/蓝转换为可抽拉设置背景颜色
RES /布局/ 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>
同时,RES /价值/ colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="Blue">#0000FF</color>
</resources>
,你可以当看,颜色确实开始#
代码是完全一样,你看到它。
我必须去文件 - >无效缓存/重新启动。
令我感到惊讶的是,这个bug仍然没有在Android Studio中修复,在SO上搜索它看起来像以其他方式困扰其他人。
即使在无效和重新启动后,错误仍然发生。 Android Studio 1.2.2在OS X上。 – 2015-07-12 01:19:59
@Aaron对我来说同样的事情,找到解决方案? – Tukajo 2015-07-14 15:01:46
我从来没有找到一个,对不起: – 2015-07-29 20:45:41
做一件事,而不是通过colour.xml添加颜色然后activity_main.xml中只是直接添加颜色的值由它的哈希颜色代码直接 到activity_main.xml中。例如,你的情况android:background="#0000FF"
如何启动与#0000FFF – 2014-10-28 21:29:19
你的蓝色应该只有六个字符?所以#0000FF不是#0000FFF – MrEngineer13 2014-10-28 21:29:39
使用此网站来指定您的颜色http://www.colorhexa.com/0000ff – 2014-10-28 21:35:47