错误:检索项的父项时出错:找不到与给定名称匹配的资源'android:Theme.Holo'



错误:未找到与给定名称匹配的资源:attr';listViewStyle';

从这里开始,我什么都试过了。什么都不起作用。

我已经将API演示导入到API版本15的eclipse,并在src文件中给出错误,如"the import com.example.android.apis.R cannot be resolve"

请帮帮我。

我在values-v11/styles.xml文件中对此有错误

<style name="ThemeHolo" parent="android:Theme.Holo">
</style>
<!-- For API level 11 or later, the Holo theme is available and we prefer that. -->
<style name="ThemeHoloDialog" parent="android:Theme.Holo.Dialog">
</style>
<!-- For API level 11 or later, we can use the magical DialogWhenLarge theme. -->
<style name="ThemeDialogWhenLarge" parent="android:style/Theme.Holo.DialogWhenLarge">
</style>

并且我在values/styles.xml中有一个错误"error:检索项的父项时出错:找不到与给定名称'@android:style/Theme.Holo.Light.NoActionBar'匹配的资源"

<style name="BadTheme" parent="@android:style/Theme.Holo.Light.NoActionBar">
</style>

您可以将Holo主题称为parent="@android:style/Theme.Holo",但要使用Holo主题,您必须将清单中的构建目标设置为API 11级或更高级别,还必须将包含Holo主题的style.xml文件放在文件夹values-v11

只需删除HOLO,因为此资源不可用于API级别的

        parent="android:Theme.Light"

将清单的android:targetSdkVersion值更改为正确的版本为我解决了这个问题。

即使在Properties等中设置正确,我也遇到过类似的问题。这似乎是Eclipse的问题。我已经删除了xml文件的内容,然后"保存",然后再次输入值,即

<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">

然后再次"保存"。

你写的正是这个吗?

<item name="android:listViewStyle"> 

我通过添加解决了同样的问题

 android:theme="@style/AppTheme"    

在AndroidManifest.xml文件中的application标记中。这将识别应用程序主题。

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" 
        android:debuggable="true" > 
        <activity 
            ...
        </activity>
      ...
</application>

相关内容

最新更新