Android 2.0:支持Actionbar库(appcompat v7支持库无资源):找不到资源@style/Theme.AppCompat.Light.DarkActionBar

2024-01-11

我跟着http://developer.android.com/guide/topics/ui/actionbar.html http://developer.android.com/guide/topics/ui/actionbar.html在 Android 2.0 中实现 ActionBar 的链接

我已遵循以下程序。

i) 创建一个新项目

ii) 在我的项目中创建一个 libs 文件夹

iii)包含 android-support-v13.jar 和 android-support-v7-appcompat.jar 文件并将它们添加到构建路径中

我的清单 xml 文件是

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.tgactionbar"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="16" />

    <application

        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        >
        <activity
            android:name="com.example.tgactionbar.MainActivity"
            android:label="@string/app_name" 
            android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

我收到这个错误

错误:错误:找不到与给定名称匹配的资源(在“主题”处,值为 '@style/Theme.AppCompat.Light.DarkActionBar')。


If you are using eclipse, adding the compatible library it's pretty easy: enter image description here

我希望这能解决您的问题。 从头开始做一个新项目并尝试这个,如果不起作用我会尝试其他事情。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android 2.0:支持Actionbar库(appcompat v7支持库无资源):找不到资源@style/Theme.AppCompat.Light.DarkActionBar 的相关文章

随机推荐