错误:检索项目的父项时出错:找不到与给定名称匹配的资源' MaterialNavigationDrawerTheme.Light.DarkActionBar'

时间:2015-01-09 12:09:26

标签: android material-design

我正在研究导航抽屉项目,我正在尝试物质主题导航抽屉我从github neokree / MaterialNavigationDrawer找到了一个例子,之后我导入了这个项目我添加了appcompat库我仍然从样式中得到这个错误。 款式:

<!-- Base application theme. -->
<style name="NavigationDrawer" parent="MaterialNavigationDrawerTheme">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">#8bc34a</item>
    <item name="colorPrimaryDark">#558b2f</item>
    <item name="colorAccent">@color/grey_1000</item>
</style>
<!-- Light version theme. -->
<style name="NavigationDrawer" parent="MaterialNavigationDrawerTheme.Light">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">#8bc34a</item>
    <item name="colorPrimaryDark">#558b2f</item>
    <item name="colorAccent">@color/grey_1000</item>
</style>
<!-- Light version with Black actionbar -->
<style name="NavigationDrawer" parent="MaterialNavigationDrawerTheme.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">#8bc34a</item>
    <item name="colorPrimaryDark">#558b2f</item>
    <item name="colorAccent">@color/grey_1000</item>
</style>

1 个答案:

答案 0 :(得分:0)

MaterialNavigationDrawerTheme.Light.DarkActionBarit.neokree:MaterialNavigationDrawer包的一部分,只要您将其添加到build.gradle(app模块)文件的依赖关系中就应该找到它(不要忘记)更改后同步):

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'it.neokree:MaterialNavigationDrawer:1.2.9'
}

您还应该只选择NavigationDrawer文件中3个styles.xml定义中的一个。