未验证 提交 a4b222bf 编写于 作者: O openharmony_ci 提交者: Gitee

!13104 挑单monthly:修复relative container用例编译问题

Merge pull request !13104 from xiexiyun/cherry-pick-1672564824
...@@ -38,66 +38,61 @@ RelativeContainer() ...@@ -38,66 +38,61 @@ RelativeContainer()
@Component @Component
struct Index { struct Index {
build() { build() {
@Entry Row() {
@Component
struct Index { RelativeContainer() {
build() { Row().width(100).height(100)
Row() { .backgroundColor("#FF3333")
.alignRules({
RelativeContainer() { top: {anchor: "__container__", align: VerticalAlign.Top},
Row().width(100).height(100) left: {anchor: "__container__", align: HorizontalAlign.Start}
.backgroundColor("#FF3333") })
.alignRules({ .id("row1")
top: {anchor: "__container__", align: VerticalAlign.Top},
left: {anchor: "__container__", align: HorizontalAlign.Start} Row().width(100).height(100)
}) .backgroundColor("#FFCC00")
.id("row1") .alignRules({
top: {anchor: "__container__", align: VerticalAlign.Top},
Row().width(100).height(100) right: {anchor: "__container__", align: HorizontalAlign.End}
.backgroundColor("#FFCC00") })
.alignRules({ .id("row2")
top: {anchor: "__container__", align: VerticalAlign.Top},
right: {anchor: "__container__", align: HorizontalAlign.End} Row().height(100)
}) .backgroundColor("#FF6633")
.id("row2") .alignRules({
top: {anchor: "row1", align: VerticalAlign.Bottom},
Row().height(100) left: {anchor: "row1", align: HorizontalAlign.End},
.backgroundColor("#FF6633") right: {anchor: "row2", align: HorizontalAlign.Start}
.alignRules({ })
top: {anchor: "row1", align: VerticalAlign.Bottom}, .id("row3")
left: {anchor: "row1", align: HorizontalAlign.End},
right: {anchor: "row2", align: HorizontalAlign.Start} Row()
}) .backgroundColor("#FF9966")
.id("row3") .alignRules({
top: {anchor: "row3", align: VerticalAlign.Bottom},
Row() bottom: {anchor: "__container__", align: VerticalAlign.Bottom},
.backgroundColor("#FF9966") left: {anchor: "__container__", align: HorizontalAlign.Start},
.alignRules({ right: {anchor: "row1", align: HorizontalAlign.End}
top: {anchor: "row3", align: VerticalAlign.Bottom}, })
bottom: {anchor: "__container__", align: VerticalAlign.Bottom}, .id("row4")
left: {anchor: "__container__", align: HorizontalAlign.Start},
right: {anchor: "row1", align: HorizontalAlign.End} Row()
}) .backgroundColor("#FF66FF")
.id("row4") .alignRules({
top: {anchor: "row3", align: VerticalAlign.Bottom},
Row() bottom: {anchor: "__container__", align: VerticalAlign.Bottom},
.backgroundColor("#FF66FF") left: {anchor: "row2", align: HorizontalAlign.Start},
.alignRules({ right: {anchor: "__container__", align: HorizontalAlign.End}
top: {anchor: "row3", align: VerticalAlign.Bottom}, })
bottom: {anchor: "__container__", align: VerticalAlign.Bottom}, .id("row5")
left: {anchor: "row2", align: HorizontalAlign.Start},
right: {anchor: "__container__", align: HorizontalAlign.End}
})
.id("row5")
}
.width(300).height(300)
.margin({left: 100})
.border({width:2, color: "#6699FF"})
}
.height('100%')
} }
.width(300).height(300)
.margin({left: 100})
.border({width:2, color: "#6699FF"})
} }
.height('100%')
} }
} }
``` ```
![relative container](figures/relativecontainer.png) ![relative container](figures/relativecontainer.png)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册