RelativeContainer() {
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 long text long text long text long text long text")
.fontSize(14)
.fontWeight(FontWeight.Lighter)
.foregroundColor('#DDDDDD')
.width('100%')
.margin({ top: 2 })
}
.id('viewRight')
.backgroundColor(0xff0000)
.margin({ left: 10 })
.alignRules({
left: { anchor: '__container__', align: HorizontalAlign.Start },
right: { anchor: '__container__', align: HorizontalAlign.End },
})
Row()
.id('viewLine')
.width(3)
.backgroundColor(0x00ff00)
.alignRules({
top: { anchor: 'viewRight', align:
VerticalAlign.Top },
bottom: { anchor: 'viewRight', align: VerticalAlign.Bottom },
})
}
.size({ width: '100%', height: 'auto' })
.margin({ top: 10 })
.backgroundColor(0x0000ff)
//RelativeContainer 可以做到,但是稍微用错容易出不明所以的 BUG