【问题标题】:Cannot resolve symbol 'AppTheme.AppCompat.Light.NoActionBar' [closed]无法解析符号“AppTheme.AppCompat.Light.NoActionBar”[关闭]
【发布时间】:2023-03-15 14:46:01
【问题描述】:

I can't understand what is the problem

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="AppTheme.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>
</resources>

【问题讨论】:

标签: android android-layout styles


【解决方案1】:

试试这个:

<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>
</resources>

还要检查您的 com.android.support:appcompat-v7 依赖项

【讨论】:

  • 我已经添加了这个依赖实现'com.android.support:appcompat-v7:26.1.0'
  • @MuhammadMuzammil 构建 > 清理项目
  • @MuhammadMuzammil 注意这个答案,她将父级从“AppTheme”更改为“主题”,这是您问题的正确父级。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-03-11
  • 1970-01-01
  • 1970-01-01
  • 2021-12-31
  • 1970-01-01
  • 2018-11-11
  • 1970-01-01
相关资源
最近更新 更多