Android - AndroidX 中的 TabLayout
Android - TabLayout in AndroidX
我刚刚尝试使用 androidX 在 Android 上实现 tabLayout,但我做不到。
androidX 上的 tabLayout 是否已弃用?
您需要添加 material 库 作为对 build.gradle
文件的依赖才能使用 TabLayout
dependencies {
implementation 'com.google.android.material:material:1.0.0'
}
还将 google()
maven 存储库包含到根 build.gradle
的 repositories
部分
allprojects {
repositories {
google()
jcenter()
}
}
You can read the Getting started with Material Components for
Android to learn more about the library.
TabLayout属于Maven神器com.android.support:design:$version
如果你想在androidX中使用TabLayout你需要添加material库
参考:https://developer.android.com/jetpack/androidx/migrate
参考:https://developer.android.com/jetpack/androidx/migrate/artifact-mappings
所以需要添加implementation 'com.google.android.material:material:1.0.0'
依赖
dependencies {
implementation 'com.google.android.material:material:1.0.0'
}
我刚刚尝试使用 androidX 在 Android 上实现 tabLayout,但我做不到。
androidX 上的 tabLayout 是否已弃用?
您需要添加 material 库 作为对 build.gradle
文件的依赖才能使用 TabLayout
dependencies {
implementation 'com.google.android.material:material:1.0.0'
}
还将 google()
maven 存储库包含到根 build.gradle
repositories
部分
allprojects {
repositories {
google()
jcenter()
}
}
You can read the Getting started with Material Components for Android to learn more about the library.
TabLayout属于Maven神器com.android.support:design:$version
如果你想在androidX中使用TabLayout你需要添加material库
参考:https://developer.android.com/jetpack/androidx/migrate
参考:https://developer.android.com/jetpack/androidx/migrate/artifact-mappings
所以需要添加implementation 'com.google.android.material:material:1.0.0'
依赖
dependencies {
implementation 'com.google.android.material:material:1.0.0'
}