Span
作为 Text、ContainerSpan组件的子组件,用于显示行内文本的组件。
常用接口
Span(value: string | Resource)
参数:
[tr]参数名参数类型必填参数描述[/tr] value | string | Resource | 是 | 文本内容。 | Demo示例: Span的使用
@Entry@Componentstruct SpanExample { build() { Column() { Text() { Span('Span') .decora tion({ type: TextDecorationType.LineThrough, color: "#000000" }) .letterSpacing(10) .font({style:FontStyle.Italic,size:"60fp"}) .textBackgroundStyle({color:Color.Green,radius:10}) .textShadow({ radius: 5, type: ShadowType.COLOR ,color:Color.Gray, offsetX: 30, offsetY: 0}) } }.width('100%').height("100%").alignItems(HorizontalAlign.Center).justifyContent(FlexAlign.Center) }}
关于Span更详细用法
|