我试图使用自定义主题 Theme.AppCompat.NoActionBar,但是 IDE 报错
找不到命名资源。请求协助。非常感谢您的帮助。
styles.xml 如下:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowActionBar">false</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorPrimaryLight">@color/primary_light</item>
<item name="colorAccent">@color/accent</item>
<item name="textColorPrimary">@color/primary_text</item>
<item name="textColorSecondary">@color/secondary_text</item>
<item name="iconColor">@color/icons</item>
<item name="dividerColor">@color/divider</item>
</style>
</resources>
颜色.xml文件如下所示:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#FF9800</color>
<color name="primary_dark">#F57C00</color>
<color name="primary_light">#FFE0B2</color>
<color name="accent">#03A9F4</color>
<color name="primary_text">#212121</color>
<color name="secondary_text">#727272</color>
<color name="icons">#212121</color>
<color name="divider">#B6B6B6</color>
</resources>