我正在研究导航抽屉项目,我正在尝试物质主题导航抽屉我从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>
答案 0 :(得分:0)
MaterialNavigationDrawerTheme.Light.DarkActionBar
是it.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
定义中的一个。