How to add cardview in layout xml in AndroidX

后端 未结 9 1070
臣服心动
臣服心动 2020-12-01 01:32

How to add cardview in layout xml in AndroidX

After upgraded to AndroidX



        
相关标签:
9条回答
  • 2020-12-01 02:28

    implementation com.google.android.material:material:1.0.0

    to

    implementation com.google.android.material:material:1.0.0-alpha1

    it is download all design related class. its work for Me

    0 讨论(0)
  • 2020-12-01 02:29

    Changes in : 1. build.gradle(:app)

    dependencies {
    ...
    implementation 'androidx.cardview:cardview:1.0.0' 
    ....
    }
    

    2. in xml section:

    <androidx.cardview.widget.CardView>
    ...
    </androidx.cardview.widget.CardView>
    
    0 讨论(0)
  • 2020-12-01 02:34

    I had the same problem in Android Studio 3.5.1. It worked for me:

    def cardview_version = "1.0.0"
    implementation "androidx.cardview:cardview:$cardview_version"
    
    
    xmln: <androidx.cardview.widget.CardView>....
    
    0 讨论(0)
提交回复
热议问题