eTS 的Text组件设置文本垂直排列的两种方式
精选原创
文章标签 开源项目 文章分类 Hadoop 大数据 yyds干货盘点
©著作权归作者所有:来自51CTO博客作者是坚果呀的原创作品,请联系作者获取转载授权,否则将追究法律责任
作者”坚果,OpenHarmony布道师,华为云享专家,InfoQ签约作者,润和软件KOL专家,电子发烧友鸿蒙MVP,51CTO博客专家博主,阿里云博客专家,开源项目gin-vue-admin成员之一。
在这里,我将为您提供两种方法。
[En]
I’m going to offer you two ways here.
首先,宽度和字体大小相同。
[En]
First, the width and font size are the same.
字体大小和宽度相同,确保每行只能容纳一种字体,而不设置高度。
[En]
The font size and width are the same, ensuring that each line can hold only one font without setting the height.
第二种旋转
预览
最后,附上了完整的源代码,那么你说的是哪一个呢?
[En]
Finally, the complete source code is attached, so which one are you talking about?
/** * @ProjectName : nutsStudy * @FileName : file * @Author : 坚果 * @Time : 2022/8/9 15:57 * @Description : 文本垂直排列的两种方式 */@Entry@Componentstruct Sample { @State imgList: Array = []; build() { Column() { Blank() //第一种,宽度,字体大小一致即可 Text("大前端之旅").fontSize(30).width(30) Blank()//第二种旋转 Text("大前端之旅").fontSize(30). rotate({x: 0,y: 0,z: 1,angle: 90,centerY: '50%',centerX:"50%"}) }.width("100%").height("80%") }}
interface BlankInterface { (min?: number | string): BlankAttribute;}
- 打赏
- 赞
- 收藏
- 评论
- *举报
下一篇:FA模型中应用包结构的参数
Original: https://blog.51cto.com/jianguo/5574381
Author: 大前端之旅
Title: eTS 的Text组件设置文本垂直排列的两种方式
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/508499/
转载文章受原作者版权保护。转载请注明原作者出处!