![](/img/trans.png)
[英]Disable 'app:layout_behavior=“@string/appbar_scrolling_view_behavior”' for child fragment
[英]which library should i implement to use app:layout_behavior=“@string/appbar_scrolling_view_behavior”
我想在 xml 文件中添加app:layout_behavior
屬性,但它不受支持。 我應該在 gradle 文件中添加哪個庫?
compile 'com.android.support:design:22.2.0
當我添加這個編譯庫 android Studio 給出錯誤時,我必須 androidx 庫來支持該app:layout_behavior
。
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
使用Material Components Library ,它是 Android 設計支持庫的替代品。
implementation 'com.google.android.material:material:1.1.0-beta02'
或最新的穩定版本:
implementation 'com.google.android.material:material:1.0.0'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.