Mah*_*eri 7 android android-view material-design android-chips material-components-android
我在我的布局中使用芯片视图
自从材料设计组件从1.0.0升级到1.1.0 后,视图的顶部和底部有一个额外的空间
我找不到任何关于如何删除这些空间的文档
在材料 1.0.0
在材料 1.1.0
<com.google.android.material.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Action"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:text="Groceries"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
Run Code Online (Sandbox Code Playgroud)
Gab*_*tti 19
它与chipMinTouchTargetSize
属性有关。
您可以在Chip
源代码中找到:
if (shouldEnsureMinTouchTargetSize()) {
setMinHeight(minTouchTargetSize);
}
Run Code Online (Sandbox Code Playgroud)
您可以chipMinTouchTargetSize
在布局或样式中更改:
<com.google.android.material.chip.Chip
app:chipMinTouchTargetSize="32dp"
../>
Run Code Online (Sandbox Code Playgroud)
或者你可以设置app:ensureMinTouchTargetSize="false"
.
请注意更改此值,因为它会更改最小触摸目标尺寸。
归档时间: |
|
查看次数: |
1726 次 |
最近记录: |