-1 works

How can I create a card view?


dashboard

Posted by @Awais malik #android #java

Step 0: Make sure that the repositories section includes Google’s Maven repository google()

allprojects {
    repositories {
      google()
      jcenter()
    }
  }
content_copyCopy to Clipboard

Step 1: Now add dependency into your manifest file

implementation 'com.android.support:design:28.0.0'
content_copyCopy to Clipboard

Step 2: Now recompile your project and if error occur then replace theme in style file with any of following

Theme.MaterialComponents
Theme.MaterialComponents.NoActionBar
Theme.MaterialComponents.Light
Theme.MaterialComponents.Light.NoActionBar
Theme.MaterialComponents.Light.DarkActionBar
content_copyCopy to Clipboard

Step 3: Now you can use material card view

  <android.support.design.card.MaterialCardView
        android:id="@+id/cardview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        >
        
    </android.support.design.card.MaterialCardView>
content_copyCopy to Clipboard

In this tutorial i will teach you how to use material design cardView in your android application

,

>> Browse more code snippets

more_vert