android - Android 如何证明芯片组中的芯片是合理的?
问题描述
如何证明 ChipGroup 中的芯片是合理的?我想使用Material Components实现chiose 芯片,但我无法证明 ChipGroup 中的芯片是合理的。
我将能够证明FlexBoxLayout中的那些是合理的,但是我必须手动处理单个选择。
<com.google.android.material.chip.ChipGroup
android:id="@+id/general_feedback_flexboxlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/general_feedback_textview_subtitle"
app:layout_constraintVertical_bias="0.0"
app:singleSelection="true">
<!--<com.google.android.flexbox.FlexboxLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--app:flexWrap="wrap"-->
<!--app:justifyContent="space_between">-->
<com.google.android.material.chip.Chip
android:id="@+id/general_feedback_chip_idea"
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checkable="true"
android:clickable="true"
android:focusable="true"
android:text="Idea"
android:textColor="@color/colorPrimaryDark"
app:chipBackgroundColor="@color/feedback_chip_state_list"
app:chipStrokeColor="@color/colorPrimaryDark"
app:chipStrokeWidth="1dp" />
<com.google.android.material.chip.Chip
android:id="@+id/general_feedback_chip_problem"
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checkable="true"
android:clickable="true"
android:focusable="true"
android:text="Problem"
android:textColor="@color/colorPrimaryDark"
app:chipBackgroundColor="@color/feedback_chip_state_list"
app:chipStrokeColor="@color/colorPrimaryDark"
app:chipStrokeWidth="1dp" />
<com.google.android.material.chip.Chip
android:id="@+id/general_feedback_chip_question"
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checkable="true"
android:clickable="true"
android:focusable="true"
android:text="Question"
android:textColor="@color/colorPrimaryDark"
app:chipBackgroundColor="@color/feedback_chip_state_list"
app:chipStrokeColor="@color/colorPrimaryDark"
app:chipStrokeWidth="1dp" />
<com.google.android.material.chip.Chip
android:id="@+id/general_feedback_chip_praise"
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checkable="true"
android:clickable="true"
android:focusable="true"
android:text="Praise"
android:textColor="@color/colorPrimaryDark"
app:chipBackgroundColor="@color/feedback_chip_state_list"
app:chipStrokeColor="@color/colorPrimaryDark"
app:chipStrokeWidth="1dp" />
<!--</com.google.android.flexbox.FlexboxLayout>-->
</com.google.android.material.chip.ChipGroup>
解决方案
推荐阅读
- python - 您如何在 CSV 文件的标题栏中写入内容?
- java - 如果方法参数是原始 int,那么方法内循环内的 myArrayList.contains(primitiveArg) 效率极低还是可以?
- node.js - 运行-p:找不到命令
- ajax - 如何使用 Ajax 将数据传递给 Django 中的模式?
- html - 检测缺少引用者的``请求的源域
- php - 从 REST API 端点显示符号名称
- python - Python pywin32 - VK_SLEEP 按下不工作
- angularjs - AngularJS 指令 $scope.$watch 用于两种方式绑定不起作用
- woocommerce - 如果应用优惠券,WooCommerce 会增加费用
- mysql - 使用 join、distinct、count 和 where 的复杂 SQL 请求