gpt4 book ai didi

android - 错误 :rendering problems The following classes could not be found android. support.v7.internal.widget.ActionBarOverlayLayout

转载 作者:IT老高 更新时间:2023-10-28 13:05:42 26 4
gpt4 key购买 nike

我只是 android 应用程序开发的初学者。当我在 Android Studio 1.1.0 上创建一个新项目时,它放弃了这个错误"渲染问题找不到以下类 android.support.v7.internal.widget.ActionBarOverlayLayout"

现在我在谷歌上搜索了这个,我发现大多数人给出的可能是 3 个解决方案。

他们说:

  1. 要么将 api(从预览窗口 Pane )从 22 更改为 21,要么

  2. 将应用主题从“项目主题”更改为任何其他主题。

  3. 确保在您的项目结构中导入了正确的 appcompat-v7 库 -> 依赖项,引用这些步骤:将支持库功能项目标识符添加到依赖项部分。例如,要包含 appcompat 项目,请将 compile "com.android.support:appcompat-v7:18.0.+"添加到依赖项部分,如下例所示:

dependencies {
...
compile "com.android.support:appcompat-v7:18.0.+" }

注意:我的 android 支持库是最新的(使用 SDK 管理器安装)。

按照前两个步骤,删除了错误。但我觉得这些都不是永久的解决方案,第二步似乎只是一个临时的解决方法。我对第一步也有疑问,如果要消除错误,我们将 api 从 22 更改为 21,那么最后,我们的应用程序将无法在 Android 5.1.1(API 22) 中运行,它将仅限于 Android 5.0 .1 及以下仅 (API 21)。我的怀疑有效吗?关于第三步,是不是这个问题的永久解决方案?

P.S : 抱歉标签不匹配,由于网站声誉,不允许添加确切的标签

最佳答案

像这样修复 res/values/styles.xml:

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar"/>

根据要求进行详细解释:Theme.AppCompat.Light.DarkActionBar 无论如何都是父类(super class) Base 的子类。 Ctrl+click (Android Studio) 你会被带到源代码:

<style name="Theme.AppCompat.Light.DarkActionBar" parent="Base.Theme.AppCompat.Light.DarkActionBar" />

我们没有改变任何东西,只是更精确地定义了它。

关于android - 错误 :rendering problems The following classes could not be found android. support.v7.internal.widget.ActionBarOverlayLayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29887722/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com