Lines Matching refs:text
1 # text开发指导
3 text是文本组件,用于呈现一段文本信息。具体用法请参考[text API](../reference/apis-arkui/arkui-js/js-components-basic-text.md…
6 ## 创建text组件
8 在pages/index目录下的hml文件中创建一个text组件。
12 <div class="container" style="text-align: center;justify-content: center; align-items: center;">
13 <text>Hello World</text>
32 ## 设置text组件样式和属性
36 设置color、font-size、allow-scale、word-spacing、text-align属性分别为文本添加颜色、大小、缩放、文本之间的间距和文本在水平方向的对齐方式。
41 <text style="color: blueviolet; font-size: 40px; allow-scale:true">
43 </text>
44 …<text style="color: blueviolet; font-size: 40px; margin-top: 20px; allow-scale:true;word-spacing: …
46 </text>
69 设置text-decoration和text-decoration-color属性为文本添加划线和划线颜色,text-decoration枚举值请参考 text自有样式。
74 <text style="text-decoration:underline">
76 </text>
77 <text style="text-decoration:line-through;text-decoration-color: red">
79 </text>
92 text{
103 当文本内容过多而显示不全时,添加text-overflow属性将隐藏内容以省略号的形式展现。
108 <text class="text">
110 </text>
124 .text{
127 text-overflow:ellipsis;
132 > - text-overflow样式需要与max-lines样式配套使用,设置了最大行数的情况下生效。
140 设置word-break属性对文本内容做断行处理,word-break枚举值请参考text自有样式。
146 <text class="text1">
148 </text>
149 <text class="text2">
151 </text>
177 text-align: center;
185 text-align: center;
194 - text组件支持[Span](../reference/apis-arkui/arkui-js/js-components-basic-span.md)子组件
199 <text style="font-size: 45px;">
201 </text>
202 <text style="font-size: 45px;">
207 </text>
215 > - 在使用Span子组件时,注意text组件内不能存在文本内容,如果存在文本内容也只会显示子组件Span里的内容。
220 text组件通过数据绑定展示文本内容,Span组件通过设置show属性来实现文本内容的隐藏和显示。
226 <text class="title">
228 </text>
231 <text class="span-container" style="color: #ff00ff;">
237 </text>
253 text-align:center;