Shapes

interface Shapes : ComposableProperties<ERROR CLASS: Symbol not found for androidx.compose.material3.Shapes>

定义了 Material 3 设计系统中的形状体系。

Material 表面可以以不同的形状显示。形状可以引导注意力、识别组件、传达状态并表达品牌。 形状体系定义了容器圆角的样式,提供了一系列从方形到完全圆形的圆润度。

形状有不同尺寸:

您可以通过覆盖组件的 shape 参数来更改其形状。

要了解更多关于形状的信息,请参阅 Material Design 形状

See also

androidx.compose.material3.MaterialTheme.shapes

Functions

Link copied to clipboard

表示 extraLarge 尺寸的圆角形状。 其尺寸大于 large 尺寸且小于 androidx.compose.foundation.shape.CircleShape。 默认情况下,大号悬浮按钮(large FABs)使用此形状。

Link copied to clipboard

表示 extraSmall 尺寸的圆角形状。 其尺寸大于 androidx.compose.ui.graphics.RectangleShape 且小于 small 尺寸。 默认情况下,自动完成菜单、选择菜单、SnackBar、标准菜单和文本字段使用此形状。

Link copied to clipboard
abstract fun getLarge(): CornerBasedShape?

表示 large 尺寸的圆角形状。 其尺寸大于 medium 且小于 extraLarge 尺寸。 默认情况下,扩展悬浮按钮(extended FABs)、常规悬浮按钮(FABs)和导航抽屉(navigation drawers)使用此形状。

Link copied to clipboard
abstract fun getMedium(): CornerBasedShape?

表示 medium 尺寸的圆角形状。 其尺寸大于 small 且小于 large 尺寸。 默认情况下,卡片(Cards)和小号悬浮按钮(small FABs)使用此形状。

Link copied to clipboard
abstract fun getSmall(): CornerBasedShape?

表示 small 尺寸的圆角形状。 其尺寸大于 extraSmall 且小于 medium 尺寸。 默认情况下,标签(Chips)使用此形状。

Link copied to clipboard
abstract fun setExtraLarge(shapeBuilder: CornerBasedShape.() -> Unit)

设置 extraLarge 尺寸的圆角形状。 其尺寸大于 large 尺寸且小于 androidx.compose.foundation.shape.CircleShape。 默认情况下,大号悬浮按钮(large FABs)使用此形状。

Link copied to clipboard
abstract fun setExtraSmall(shapeBuilder: CornerBasedShape.() -> Unit)

设置 extraSmall 尺寸的圆角形状。 其尺寸大于 androidx.compose.ui.graphics.RectangleShape 且小于 small 尺寸。 默认情况下,自动完成菜单、选择菜单、SnackBar、标准菜单和文本字段使用此形状。

Link copied to clipboard
abstract fun setLarge(shapeBuilder: CornerBasedShape.() -> Unit)

设置 large 尺寸的圆角形状。 其尺寸大于 medium 且小于 extraLarge 尺寸。 默认情况下,扩展悬浮按钮(extended FABs)、常规悬浮按钮(FABs)和导航抽屉(navigation drawers)使用此形状。

Link copied to clipboard
abstract fun setMedium(shapeBuilder: CornerBasedShape.() -> Unit)

设置 medium 尺寸的圆角形状。 其尺寸大于 small 且小于 large 尺寸。 默认情况下,卡片(Cards)和小号悬浮按钮(small FABs)使用此形状。

Link copied to clipboard
abstract fun setSmall(shapeBuilder: CornerBasedShape.() -> Unit)

设置 small 尺寸的圆角形状。 其尺寸大于 extraSmall 且小于 medium 尺寸。 默认情况下,标签(Chips)使用此形状。