TextUnit

interface TextUnit : ComposableProperties<ERROR CLASS: Symbol not found for androidx.compose.ui.unit.TextUnit>

表示用于文本相关尺寸(如字体大小、行高)的单位。

此接口封装了 androidx.compose.ui.unit.TextUnit,它结合了一个浮点数值和一个 TextUnitType(Sp 或 Em)。 在脚本中,它通常用于设置或验证文本组件的尺寸属性。 实例应通过 TextUnits 工厂创建。

Author

M8Test, [email protected], https://m8test.com

See also

androidx.compose.ui.unit.TextUnit

Functions

Link copied to clipboard
abstract fun getType(): TextUnitType

获取此文本单位的类型。

Link copied to clipboard
abstract fun getValue(): Float

获取此文本单位的数值部分。

Link copied to clipboard
abstract fun isEm(): Boolean

检查此文本单位的类型是否为 Em。

Link copied to clipboard
abstract fun isSp(): Boolean

检查此文本单位的类型是否为 Sp。

Link copied to clipboard
abstract fun isSpecified(): Boolean

检查此文本单位是否已指定具体值和类型。

Link copied to clipboard
abstract fun isUnspecified(): Boolean

检查此文本单位是否为 Unspecified