【问题标题】:Failed to load AppCompat ActionBar constraints layout Android Studio 3.1.3无法加载 AppCompat ActionBar 约束布局 Android Studio 3.1.3
【发布时间】:2019-01-16 04:29:20
【问题描述】:

这是我第一次使用 Android Studio,我不知道这些错误是什么意思,我看到许多解决方案包括将 appcomat 更改为 alpha1 并将主题更改为 base.theme 和许多但没有人在工作

渲染问题 "在当前主题中找不到样式 'coordinatorLayoutStyle' 提示:尝试刷新布局。"

Gradle 脚本>build.gradle

依赖{ 实现文件树(目录:'libs',包括:['*.jar']) 实施 'com.android.support:appcompat-v7:28.0.0-rc01' 实施 'com.android.support.constraint:constraint-layout:1.1.2' 实施 'com.android.support:design:28.0.0-rc01' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' }

res>值>style.xml 样式名称="AppTheme" 父="Base.Theme.AppCompat.Light.DarkActionBar" @color/colorPrimary @color/colorPrimaryDark @color/colorAccent

图 1

图二

【问题讨论】:

  • 尝试在你的xml风格中添加这个<item name="coordinatorLayoutStyle">@style/Widget.Support.CoordinatorLayout</item>

标签: android android-layout android-studio android-fragments android-constraintlayout


【解决方案1】:

打开你的 build.gradle(Module: app)

实现'com.android.support:appcompat-v7:28.0.0-alpha1'

而不是

实现'com.android.support:appcompat-v7:28.0.0-rc01'

希望对您有所帮助

【讨论】:

    【解决方案2】:

    这些是我的依赖,它对我来说很好用

    dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'android.arch.core:runtime:1.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.firebaseui:firebase-ui-firestore:4.1.0'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    compile 'com.google.firebase:firebase-core:16.0.0'
    apply plugin: 'com.google.gms.google-services'
    

    }

    【讨论】:

      【解决方案3】:

      Base.Theme.AppCompat.Light.DarkActionBar 更改为Theme.AppCompat.Light.DarkActionBar。希望它会起作用。

      【讨论】:

        猜你喜欢
        • 2018-11-29
        • 2023-03-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-10-15
        • 2018-12-21
        • 2018-12-19
        相关资源
        最近更新 更多