<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 基础应用程序主题,默认主题 -->
<style name="Theme" parent="android:Theme"></style><!-- 更改应用程序的主题,使之具有半透明translucent的背景 -->
<style name="Theme.Translucent">
<item name="android:windowBackground">@drawable/translucent_background</item>
<item name="android:windowNoTitle">false</item>
<item name="android:colorForeground">@drawable/blue</item>
<item name="android:colorBackground">@drawable/pink</item>
</style><!-- 更改应用程序的主题,使之具有不同颜色的背景,且具有半透明translucent的背景 -->
<style name="Theme.Translucent2">
<item name="android:windowBackground">@drawable/pink</item>
<item name="android:windowNoTitle">false</item>
<item name="android:colorForeground">@drawable/darkgreen</item>
<item name="android:colorBackground">@drawable/pink</item>
</style><!-- 更改应用程序的主题 ,使之具有透明transparent的背景 -->
<style name="Theme.transparent">
<item name="android:windowBackground">@drawable/transparent_background</item>
<item name="android:windowNoTitle">true</item>
<item name="android:colorForeground">@drawable/blue</item>
<item name="android:colorBackground">@drawable/pink</item>
</style><style name="TextAppearance.Theme.PlainText"
parent="android.TextAppearance.Theme">
<item name="android:textStyle">normal</item>
</style>
</resources>为什么老是提示<style name="TextAppearance.Theme.PlainText"这行有错误。
error: Error retrieving parent for item: No resource found that matches the given name 'android.TextAppearance.Theme'.把那个style注释掉之后,上面的第二个style中<item name="android:colorBackground">@drawable/pink</item>
又提示错误 
error: Error: No resource found that matches the given name (at 'android:colorBackground' with value '@drawable/pink').
如果再把这行注释掉,则上一行又继续报错。。都快疯掉了。
我是按照google android sdk开发范例大全的教程上的代码写的啊。

解决方案 »

  1.   

    <style name="TextAppearance.Theme.PlainText> 改为:<style name="Theme.PlainText>就是去掉TextAppearance.好像没有colorBackground属性,改为android:background
      

  2.   

    <item name="android:colorForeground">@drawable/blue</item>
    <item name="android:colorBackground">@drawable/pink</item>在drawable目录下没有blue 和pink这两张图吧?
    楼主看看!!
      

  3.   

    <style name="TextAppearance.Theme.PlainText"
        parent="android.TextAppearance.Theme">
    parent的格式错了,改为:android:style/TextAppearance_Theme试试
      

  4.   


    是的,没有在drawable下定义这些值,我在colors.xml中定义了这些颜色之后,就正常了。
    我原以为这些值是android默认自带的呢。
    BS下某些书上的代码,如果不是自己照着书上的代码自己做一遍,还以为是正确的呢。
      

  5.   


    你这样改,有依据么?我看android developer网站上都是按照我原先那样写的。在colors.xml中添加那些值后,就正常了。
    http://developer.android.com/resources/samples/ApiDemos/res/values/styles.html