发布于 2018-04-17 08:48:30
该特性包含在支持库版本28.0.0-alpha1中。
若要使用该功能:
在app gradle文件中:
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'
}在布局文件中:
<android.support.design.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Entry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:chipIcon="@drawable/ic_arrow_drop_down_black_24dp"
app:chipText="hello"/>发布于 2019-03-02 09:36:09
如果您正在使用材料库
您可以使用材料芯片com.google.android.material.chip.Chip和implementation 'com.google.android.material:material:1.0.0'在build.gradle中添加
Filter style="@style/Widget.MaterialComponents.Chip.Filter"
Choice Chips style="@style/Widget.MaterialComponents.Chip.Choice"
Entry input: style="@style/Widget.MaterialComponents.Chip.Entry"https://stackoverflow.com/questions/49076430
复制相似问题