5

I just tried to implement tabLayout on Android with androidX and im not able to do it.

Is tabLayout on androidX deprecated?

1

2 Answers 2

4

You need to add material library as a dependency to build.gradle file to use TabLayout

dependencies {
    implementation 'com.google.android.material:material:1.0.0'
}

also inclue google() maven repository to the repositories section of the root build.gradle

allprojects {
    repositories {
      google()
      jcenter()
    }
}

You can read the Getting started with Material Components for Android to learn more about the library.

Sign up to request clarification or add additional context in comments.

Comments

0

TabLayout belongs to Maven artifact com.android.support:design:$version

if you want to use TabLayout in androidX you need to add material library

Ref : https://developer.android.com/jetpack/androidx/migrate

Ref : https://developer.android.com/jetpack/androidx/migrate/artifact-mappings

so you need to add implementation 'com.google.android.material:material:1.0.0' in dependency.

dependencies {
    implementation 'com.google.android.material:material:1.0.0'
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.