这里有搞鸿蒙开发的兄弟吗?今天遇到一个问题,搞了半天也没搞定。需求很简单就是让左边的竖线跟随整个 Row 的高度变化,整个 Row 的高度不定,后面的文本可能会换行。 Row() { // Vertical line decoration Row() .width(3) .height('100%') .backgroundColor('#DDDDDD')
Column() {
Row() {
Text("Test1111")
.fontSize(14)
.fontWeight(FontWeight.Lighter)
.fontStyle(FontStyle.Italic)
.foregroundColor('#DDDDDD')
.flexGrow(1)
Button() {
Text("button")
.width(30)
.height(30)
}
.width(30)
.height(30)
.backgroundColor(Color.Transparent)
.foregroundColor('#DDDDDD')
}
.width('100%')
.alignItems(VerticalAlign.Top)
Text("long text long text long text long text long text ")
.fontSize(14)
.fontWeight(FontWeight.Lighter)
.foregroundColor('#DDDDDD')
.width('100%')
.margin({ top: 2 })
}
.margin({ left: 7 })
.layoutWeight(1)
}
.alignItems(VerticalAlign.Top)
.width('100%')
.margin({ top: 10 })
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.