首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >要使用app:layout_behavior="@string/appbar_scrolling_view_behavior“,我应该实现哪个库

要使用app:layout_behavior="@string/appbar_scrolling_view_behavior“,我应该实现哪个库
EN

Stack Overflow用户
提问于 2019-09-25 17:40:55
回答 1查看 58关注 0票数 1

我想在xml文件中添加app:layout_behavior属性,但它不受支持。我应该在gradle文件中添加哪个库?

代码语言:javascript
复制
compile 'com.android.support:design:22.2.0

当我添加这个编译库时,android Studio会给出错误,我必须使用androidx库来支持app:layout_behavior

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.example.expensemanager"
        minSdkVersion 16
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    implementation 'com.google.firebase:firebase-analytics:17.2.0'
    implementation 'com.google.firebase:firebase-auth:19.0.0'
    implementation 'com.google.firebase:firebase-database:19.1.0'
    implementation 'com.google.firebase:firebase-functions:19.0.1'
    implementation 'androidx.cardview:cardview:1.0.0'


}
apply plugin: 'com.google.gms.google-services'

请告诉我我应该实现什么来支持app:layout_behavior

EN

回答 1

Stack Overflow用户

发布于 2019-09-25 17:59:58

使用Material Components Library,它是安卓设计支持库的临时替代品。

代码语言:javascript
复制
implementation 'com.google.android.material:material:1.1.0-beta02'

或者是最新的稳定版本:

代码语言:javascript
复制
implementation 'com.google.android.material:material:1.0.0'
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58095515

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档