Android 2.0 : Support Actionbar library (appcompat v7 support library without resources):No resource found @style/Theme. AppCompat.Light.DarkActionBar

标签 android actionbarsherlock android-support-library

我关注了 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 文件并将它们添加到构建路径

我的 Manifierst 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').

最佳答案

如果您使用的是 Eclipse,那么添加兼容库非常简单: enter image description here

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

关于Android 2.0 : Support Actionbar library (appcompat v7 support library without resources):No resource found @style/Theme. AppCompat.Light.DarkActionBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18822499/

相关文章:

Android java.lang.ClassCastException : android. widget.LinearLayout 无法转换为 android.widget.TextView

android - ActionBarSherlock 上 activatedBackgroundIndicator 的自定义背景不起作用

android - 无法解决@style/Theme.Sherlock

android - 我可以以编程方式打开带有动画的抽屉布局吗?

android - 使用不同版本的 Android 支持库的解决方法

android - 如何从源代码构建 v4 支持库

android - 菜单项不可见

android - 如何在 Honeycomb+ 设备的 Android 通知中显示时间戳?

Android从字符串中识别一个整数

android - 我的 Android XML 文件找不到 ActionBarSherlock 主题