Material 设计主题错误
Material Design Theme Error
我最近决定在我的申请中开始使用 "material design"。编译期间出现此错误:
Error:(12, 22) No resource found that matches the given name: attr 'windowNoTitle'.
下面是指向这个styles.xml
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="MyMaterialTheme" parent="MyMaterialTheme.Base">
</style>
<style name="MyMaterialTheme.Base" parent="Theme.AppCompat">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
将 <item name="windowNoTitle">true</item>
更改为 <item name="android:windowNoTitle">true</item>
。
只有一些属性,主要与 appcompat-v7
库相关,需要 android:
-less 版本。对于所有其他人,您应该始终使用 android 前缀。
我最近决定在我的申请中开始使用 "material design"。编译期间出现此错误:
Error:(12, 22) No resource found that matches the given name: attr 'windowNoTitle'.
下面是指向这个styles.xml
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="MyMaterialTheme" parent="MyMaterialTheme.Base">
</style>
<style name="MyMaterialTheme.Base" parent="Theme.AppCompat">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
将 <item name="windowNoTitle">true</item>
更改为 <item name="android:windowNoTitle">true</item>
。
只有一些属性,主要与 appcompat-v7
库相关,需要 android:
-less 版本。对于所有其他人,您应该始终使用 android 前缀。