java - 在 android 中实现支持库 v7 中的样式

标签 java android android-studio gradle android-support-library

我正在尝试在我的项目中实现支持库 v7,但遇到了与其 bundle 的样式问题。

Error:(2) Error retrieving parent for item: 

No resource found that matches the given name

 'Theme.AppCompat.Light.DarkActionBar.'.

我已经在我的 build.gradle 中包含了 com.android.support:appcompat-v7:23.1.1,但它没有帮助。

这是我的 build.gradle 依赖项

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.1.0'
    compile 'com.android.support:support-annotations:+'
    compile 'com.android.support:appcompat-v7:23.1.1'
} 

这是我的 styles.xml,它导致了错误

<resources>
   <style name="AppBaseTheme" parent="android:Theme.Light"> </style>
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar."></style>
 <!-- erorr here -->
</resources>

我使用的是 Android Studio 1.4,buildToolsVersion 为“23.0.2”。

最佳答案

您的风格有错误。 删除点。

Theme.AppCompat.Light.DarkActionBar

而不是

Theme.AppCompat.Light.DarkActionBar.

关于java - 在 android 中实现支持库 v7 中的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33796931/

相关文章:

Android - 在 onCreate 中收到的 getArguments 和 Bundle 有什么区别

android - 适用于 Android 和 iOS 的 2D 跨平台游戏引擎?

安卓工作室 : ExternalSystemException

android - Android Studio 3.1.x 中的 Constraint Layout Editor 是否已经支持 AndroidX?

javascript - 将 JavaScript 文字传递给 :onclick 时,Thymeleaf 找不到我的变量

java - 静态绑定(bind)和动态绑定(bind)用例

android-studio - 是否有在两个不同的 android studio 实例之间切换的捷径

java - 无法与 WPA2 android 连接

java - Stripes 框架中的对话范围