main,.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/grey"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
color.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="darkgray">#808080FF </drawable>
<drawable name="white">#FFFFFFF</drawable>
</resources> 没报错跑起来背景还是没变,这是为什么呢
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/grey"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
color.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="darkgray">#808080FF </drawable>
<drawable name="white">#FFFFFFF</drawable>
</resources> 没报错跑起来背景还是没变,这是为什么呢
color.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="darkgray">#808080FF </color>
<color name="white">#FFFFFFFF</color>
</resources>
这样也一样不行。
另外第一个drawable中,white中F只有7个
跟少的那个F貌似没关系
不行
那个是后来换的代码
<resources>
<drawable name="darkgray">#808080FF </drawable>
<drawable name="white">#FFFFFFFF</drawable>
</resources>
main.xml<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/white"
android:orientation="vertical" > <TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" /></LinearLayout>
上面本机上给你试了一下,没问题,你的代码错误就刚才说的grey没定义,white的F是7个,其它没错误