我在应用程序主题的styles.xml 中有错误

萨马尔·艾哈迈德 |

这是我的AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sammar.materialdeisgn">

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme.NoActionBar">
    <activity
        android:name=".MainActivity"
        android:label="YourAppName"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
 </application>

</manifest>

这是我的styles.xml

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

我收到以下错误:

1)Error:No resource found that matches the given name (at 'theme' with value '@style/AppTheme.NoActionBar').



 2)Error:No resource found that matches the given name (at 'theme' with value '@style/AppTheme.NoActionBar').



 3)Error:No resource found that matches the given name (at 'theme' with value '@style/AppTheme.NoActionBar').



 4)Error:No resource found that matches the given name (at 'theme' with value '@style/AppTheme.NoActionBar').



 5)Error:Execution failed for task ':app:processDebugResources'.



 > com.android.ide.common.process.ProcessException: Failed to execute 

aapt
奥米克

您的清单样式未引用NoActionBar主题,因此请添加以下行

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

所以你的Style.xml样子

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
</resources>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

我需要 20 个在 pom.xml 中有错误的入门项目

我的 xml 代码中有一个错误,导致所有应用程序停止

我的查询中有错误

我在时区设置中有错误

我在R.java中有错误?

我在 Verilog 上的定义中有错误 for

刽子手游戏在我的选择方法中有错误

Windows Metro应用程序的搜索UI中有错误的图标

我的 angular 应用程序中有一个 http 错误接收器。我正在从后端捕获所有错误。如何显示所有错误?

我在joomla中有一个错误-请查询。我在这个查询中有错误

我的代码中有错误,当前错误是 TypeError: 'NoneType' object is not subscriptable

我在应用程序中有一些错误

我现在没有,为什么我在这个 sql 请求中有错误

即使构建应用程序时没有错误,我的应用程序也会崩溃

当我有单逗号和|时,SQL语法中有错误。

处理程序“ ExtensionlessUrlHandler-Integrated-4.0”的模块列表中有错误的模块“ ManagedPipelineHandler”

如果我们在CloudFormation中有错误条件和Ref会发生什么?

我正在尝试更新表SQL的值Java中有错误

discord.py 在我的不和谐机器人中有错误如何修复?

我在 mysql 函数中有错误?ERROR 不允许从函数返回结果集

pyspark agg 告诉我列名称中有错误的字符,但名称似乎正确

如何使用 case_when 而不是 if_else [我的代码中有错误?]

坚持修复此查询,我写的两个命令中有错误

我在 OpenCV 中有错误“approxPolyDP(ROI_Vertices, ROI_Poly, 1.0, true)”

当我使用 ConcurrentMessageListenerContainer 时,如何跳过在 kafka 中有错误的味精?

我在服务器会话中有错误,无法解决

如果pom.xml文件中有错误,则在创建Maven项目时可能会出错

从styles.xml切换应用程序主题时,是否可以更改项目的可见性?

我没有错误,但为什么我的应用程序闭上