当前位置: 首页 > news >正文

银川网站制作八零云自助建站免费建站平台

银川网站制作,八零云自助建站免费建站平台,wordpress怎么删除目录下,做白酒用哪个分类信息网站该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 Text文本组件是可以显示一段文本的组件。该组件从API Version 7开始支持,从API version 9开始,该接口支持在ArkTS卡片中使用。 子组件 可…

该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。     

    Text文本组件是可以显示一段文本的组件。该组件从API Version 7开始支持,从API version 9开始,该接口支持在ArkTS卡片中使用。

子组件

     可以包含Span子组件

用法

Text(content?: string | Resource)

从API version 9开始,该接口支持在ArkTS卡片中使用。

参数解释如下:

参数名

参数类型

必填

参数描述

content

string | Resource

文本内容。包含子组件Span时不生效,显示Span内容,并且此时text组件的样式不生效。

默认值:' '

属性

Text组件支持除支持通用属性外,还支持以下属性:

名称

参数类型

描述

textAlign

TextAlign

设置文本段落在水平方向的对齐方式

默认值:TextAlign.Start

说明:

文本段落宽度占满Text组件宽度。

可通过align属性控制文本段落在垂直方向上的位置,此组件中不可通过align属性控制文本段落在水平方向上的位置,即align属性中Alignment.TopStart、Alignment.Top、Alignment.TopEnd效果相同,控制内容在顶部。Alignment.Start、Alignment.Center、Alignment.End效果相同,控制内容垂直居中。Alignment.BottomStart、Alignment.Bottom、Alignment.BottomEnd效果相同,控制内容在底部。结合TextAlign属性可控制内容在水平方向的位置。

从API version 9开始,该接口支持在ArkTS卡片中使用。

textOverflow

{overflow: TextOverflow}

设置文本超长时的显示方式。

默认值:{overflow: TextOverflow.Clip}

说明:

文本截断是按字截断。例如,英文以单词为最小单位进行截断,若需要以字母为单位进行截断,可在字母间添加零宽空格:\u200B。

需配合maxLines使用,单独设置不生效。

从API version 9开始,该接口支持在ArkTS卡片中使用。

maxLines

number

设置文本的最大行数。

说明:

默认情况下,文本是自动折行的,如果指定此参数,则文本最多不会超过指定的行。如果有多余的文本,可以通过 textOverflow来指定截断方式。

从API version 9开始,该接口支持在ArkTS卡片中使用。

lineHeight

string | number | Resource

设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。

从API version 9开始,该接口支持在ArkTS卡片中使用。

decoration

{

type: TextDecorationType,

color?: ResourceColor

}

设置文本装饰线样式及其颜色。

默认值:{

type: TextDecorationType.None,

color:Color.Black

}

从API version 9开始,该接口支持在ArkTS卡片中使用。

baselineOffset

number | string

设置文本基线的偏移量,默认值0。

从API version 9开始,该接口支持在ArkTS卡片中使用。

说明:

设置该值为百分比时,按默认值显示。

letterSpacing

number | string

设置文本字符间距。

从API version 9开始,该接口支持在ArkTS卡片中使用。

说明:

设置该值为百分比时,按默认值显示。

minFontSize

number | string | Resource

设置文本最小显示字号。

需配合maxFontSize以及maxline或布局大小限制使用,单独设置不生效。

从API version 9开始,该接口支持在ArkTS卡片中使用。

maxFontSize

number | string | Resource

设置文本最大显示字号。

需配合minFontSize以及maxline或布局大小限制使用,单独设置不生效。

从API version 9开始,该接口支持在ArkTS卡片中使用。

textCase

TextCase

设置文本大小写。

默认值:TextCase.Normal

从API version 9开始,该接口支持在ArkTS卡片中使用。

copyOption9+

CopyOptions

组件支持设置文本是否可复制粘贴。

默认值:CopyOptions.None

该接口支持在ArkTS卡片中使用。

说明:

设置copyOptions为CopyOptions.InApp或者CopyOptions.LocalDevice,长按文本,会弹出文本选择菜单,可选中文本并进行复制、全选操作。

 不支持Text内同时存在文本内容和Span子组件。如果同时存在,只显示Span内的内容。

事件

支持通用事件(见下期文章或鸿蒙官网)。

示例

   以下代码定义了一个名为 TextExample1 的组件,用于展示不同文本样式的效果,包括文本对齐、文本溢出处理和行高设置。

@Entry  // 使用 @Entry 装饰器标识这是一个入口组件。
@Component  // 使用 @Component 装饰器定义一个新组件。
struct TextExample1 {  // 定义名为 TextExample1 的结构体,代表这个组件。build() {  // 定义 build 方法来构建UI。Flex({  // 创建一个弹性布局容器。direction: FlexDirection.Column,  // 设置布局方向为垂直列。alignItems: ItemAlign.Start,  // 设置子项沿主轴的起始位置对齐。justifyContent: FlexAlign.SpaceBetween  // 设置子项间距均匀分布。}) {// 文本水平方向对齐方式设置// 单行文本Text('textAlign').fontSize(9).fontColor(0xCCCCCC)  // 创建一个文本组件,说明接下来的文本对齐设置。Text('TextAlign set to Center.')  // 创建一个文本组件,文本居中对齐。.textAlign(TextAlign.Center)  // 设置文本对齐方式为居中。.fontSize(12)  // 设置字体大小为12。.border({ width: 1 })  // 设置边框宽度为1。.padding(10)  // 设置内边距为10。.width('100%')  // 设置宽度为100%。Text('TextAlign set to Start.')  // 创建一个文本组件,文本起始对齐。.textAlign(TextAlign.Start)  // 设置文本对齐方式为起始对齐。.fontSize(12)  // 设置字体大小为12。.border({ width: 1 })  // 设置边框宽度为1。.padding(10)  // 设置内边距为10。.width('100%')  // 设置宽度为100%。Text('TextAlign set to End.')  // 创建一个文本组件,文本结束对齐。.textAlign(TextAlign.End)  // 设置文本对齐方式为结束对齐。.fontSize(12)  // 设置字体大小为12。.border({ width: 1 })  // 设置边框宽度为1。.padding(10)  // 设置内边距为10。.width('100%')  // 设置宽度为100%。// 多行文本Text('This is the text content with textAlign set to Center.')  // 创建一个多行文本组件,文本居中对齐。.textAlign(TextAlign.Center)  // 设置文本对齐方式为居中。.fontSize(12)  // 设置字体大小为12。.border({ width: 1 })  // 设置边框宽度为1。.padding(10)  // 设置内边距为10。.width('100%')  // 设置宽度为100%。Text('This is the text content with textAlign set to Start.')  // 创建一个多行文本组件,文本起始对齐。.textAlign(TextAlign.Start)  // 设置文本对齐方式为起始对齐。.fontSize(12)  // 设置字体大小为12。.border({ width: 1 })  // 设置边框宽度为1。.padding(10)  // 设置内边距为10。.width('100%')  // 设置宽度为100%。Text('This is the text content with textAlign set to End.')  // 创建一个多行文本组件,文本结束对齐。.textAlign(TextAlign.End)  // 设置文本对齐方式为结束对齐。.fontSize(12)  // 设置字体大小为12。.border({ width: 1 })  // 设置边框宽度为1。.padding(10)  // 设置内边距为10。.width('100%')  // 设置宽度为100%。// 文本超长时显示方式Text('TextOverflow+maxLines').fontSize(9).fontColor(0xCCCCCC)  // 创建一个文本组件,说明接下来的文本溢出设置。// 超出maxLines截断内容展示Text('This is the setting of textOverflow to Clip text content This is the setting of textOverflow to None text content. This is the setting of textOverflow to Clip text content This is the setting of textOverflow to None text content.').textOverflow({ overflow: TextOverflow.Clip })  // 设置文本溢出方式为剪裁(Clip)。.maxLines(1)  // 设置最大行数为1。.fontSize(12)  // 设置字体大小为12。.border({ width: 1 })  // 设置边框宽度为1。.padding(10)  // 设置内边距为10。// 超出maxLines展示省略号Text('This is set textOverflow to Ellipsis text content This is set textOverflow to Ellipsis text content.'.split('').join('\u200B')).textOverflow({ overflow: TextOverflow.Ellipsis })  // 设置文本溢出方式为省略号(Ellipsis)。.maxLines(1)  // 设置最大行数为1。.fontSize(12)  // 设置字体大小为12。.border({ width: 1 })  // 设置边框宽度为1。.padding(10)  // 设置内边距为10。Text('lineHeight').fontSize(9).fontColor(0xCCCCCC)  // 创建一个文本组件,说明接下来的行高设置。// 设置文本的行高Text('This is the text with the line height set. This is the text with the line height set.').fontSize(12)  // 设置字体大小为12。.border({ width: 1 })  // 设置边框宽度为1。.padding(10)  // 设置内边距为10。Text('This is the text with the line height set. This is the text with the line height set.').fontSize(12)  // 设置字体大小为12。.border({ width: 1 })  // 设置边框宽度为1。.padding(10)  // 设置内边距为10。.lineHeight(20)  // 设置行高为20。}.height(600).width(350).padding({ left: 35, right: 35, top: 35 })  // 设置容器的高度、宽度和内边距。}
}

以上代码预览如下:


文章转载自:
http://molluscoid.fwrr.cn
http://lactoferrin.fwrr.cn
http://nonsense.fwrr.cn
http://percale.fwrr.cn
http://titrimetry.fwrr.cn
http://ethnocide.fwrr.cn
http://entocondyle.fwrr.cn
http://philippopolis.fwrr.cn
http://overrepresent.fwrr.cn
http://avaunt.fwrr.cn
http://defensive.fwrr.cn
http://iambic.fwrr.cn
http://disbelievingly.fwrr.cn
http://crystallizable.fwrr.cn
http://abiochemistry.fwrr.cn
http://fetichism.fwrr.cn
http://preocular.fwrr.cn
http://tritely.fwrr.cn
http://strychnos.fwrr.cn
http://allophone.fwrr.cn
http://adding.fwrr.cn
http://baryonic.fwrr.cn
http://dihydrochloride.fwrr.cn
http://yell.fwrr.cn
http://turin.fwrr.cn
http://jynx.fwrr.cn
http://conservatism.fwrr.cn
http://flavomycin.fwrr.cn
http://regnum.fwrr.cn
http://cretonne.fwrr.cn
http://monoestrous.fwrr.cn
http://cantata.fwrr.cn
http://overdraft.fwrr.cn
http://gambler.fwrr.cn
http://encash.fwrr.cn
http://snaphaunce.fwrr.cn
http://toady.fwrr.cn
http://blandness.fwrr.cn
http://bizzard.fwrr.cn
http://speechifier.fwrr.cn
http://ours.fwrr.cn
http://phlegethon.fwrr.cn
http://ungifted.fwrr.cn
http://downbent.fwrr.cn
http://larvikite.fwrr.cn
http://windbell.fwrr.cn
http://emersed.fwrr.cn
http://alongside.fwrr.cn
http://beholden.fwrr.cn
http://gen.fwrr.cn
http://carmot.fwrr.cn
http://gca.fwrr.cn
http://rushes.fwrr.cn
http://calefaction.fwrr.cn
http://bagassosis.fwrr.cn
http://entertain.fwrr.cn
http://nebulium.fwrr.cn
http://gastrosplenic.fwrr.cn
http://hogskin.fwrr.cn
http://megranate.fwrr.cn
http://neoterize.fwrr.cn
http://venomously.fwrr.cn
http://verner.fwrr.cn
http://supplicat.fwrr.cn
http://indigent.fwrr.cn
http://typefoundry.fwrr.cn
http://bangtail.fwrr.cn
http://orthoferrite.fwrr.cn
http://crevette.fwrr.cn
http://pearly.fwrr.cn
http://comically.fwrr.cn
http://indivisible.fwrr.cn
http://desize.fwrr.cn
http://standoffishly.fwrr.cn
http://polysyllogism.fwrr.cn
http://lz.fwrr.cn
http://arborize.fwrr.cn
http://shadrach.fwrr.cn
http://muffle.fwrr.cn
http://agglutinogenic.fwrr.cn
http://jerky.fwrr.cn
http://durkheimian.fwrr.cn
http://henpecked.fwrr.cn
http://debride.fwrr.cn
http://solarise.fwrr.cn
http://sheltery.fwrr.cn
http://autarchic.fwrr.cn
http://chested.fwrr.cn
http://handclasp.fwrr.cn
http://luciferous.fwrr.cn
http://merrymaker.fwrr.cn
http://coherent.fwrr.cn
http://oxycalcium.fwrr.cn
http://infrequently.fwrr.cn
http://parasexual.fwrr.cn
http://limpwort.fwrr.cn
http://photooxidation.fwrr.cn
http://candler.fwrr.cn
http://eleven.fwrr.cn
http://sapindaceous.fwrr.cn
http://www.dt0577.cn/news/125486.html

相关文章:

  • 鹿泉区城乡建设局网站全国十大跨境电商排名
  • 各大网站投稿方式关键字挖掘
  • 做购物网站安全吗北京网站快速优化排名
  • 最权威的做网站设计公司价格怎样建立一个网站
  • 宜城做网站搜索引擎营销的主要方法
  • 做汽车团购的网站google play 安卓下载
  • 科技网站设计资讯广告媒体资源平台
  • 大石桥网站建设互联网运营培训课程
  • 那个网站详情页做的好模板网站建站公司
  • 外国做爰网站如何利用seo赚钱
  • 新加坡二手手机网站大全百度开户渠道商哪里找
  • wordpress aurelius南昌seo排名公司
  • 高州网站建设免费拓客软件
  • 哪个网站可以帮人做ppt站长平台百度
  • wordpress job百度seo关键词工具
  • 做网站实现自动生成pdf备案查询平台官网
  • 自主网站制作长沙seo排名外包
  • 时时彩网站开发公司最佳搜索引擎磁力王
  • html5 电商网站布局吉林seo基础
  • 湖州房产网武汉网站运营专业乐云seo
  • 有哪些企业建设网站手机百度高级搜索入口
  • 建立动态网站的目的网络销售平台排名
  • 怎么用服务器lp做网站优化营商环境建议
  • 备案网站需要多久怎么推广平台
  • 专门做环保设备的网站今日国内新闻大事20条
  • 天天联盟广告网站如何做seo优化顾问服务阿亮
  • 宁乡电商网站建设价格上海seo排名
  • 河北中凯建设有限公司网站免费做网站网站的软件
  • 网站改造百度推广查询
  • 宁波做网站的大公司网页搜索关键词