How to use Chips component from android support library?

前端 未结 2 1872
南旧
南旧 2021-01-02 18:08

I have read the documentation on the official website. But I was unable to implement Chip in my project following the documentation. Android Studio can\'t find and import

2条回答
  •  一个人的身影
    2021-01-02 18:58

    The feature is included in support library version 28.0.0-alpha1. To use the feature:

    In app gradle file:

    android {
    compileSdkVersion 'android-P'
    }
    
    dependencies {
      implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
    
      implementation 'com.android.support:design:28.0.0-alpha1'
      // OR
      implementation 'com.android.support:design-chip:28.0.0-alpha1'
    }
    

    In Layout file:

    
    

    Guidelines : https://material.io/guidelines/components/chips.html

提交回复
热议问题