From 6f03c5b912977fad3bddc2c2485479e553a16250 Mon Sep 17 00:00:00 2001 From: yeyinglong Date: Thu, 6 Apr 2023 15:35:31 +0800 Subject: [PATCH] =?UTF-8?q?List=20Grid=E7=BB=84=E4=BB=B6=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=E9=BB=98=E8=AE=A4=E7=8A=B6=E6=80=81=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yeyinglong --- .../OpenHarmony_4.0.5.5/changelogs-arkui.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 zh-cn/release-notes/changelogs/OpenHarmony_4.0.5.5/changelogs-arkui.md diff --git a/zh-cn/release-notes/changelogs/OpenHarmony_4.0.5.5/changelogs-arkui.md b/zh-cn/release-notes/changelogs/OpenHarmony_4.0.5.5/changelogs-arkui.md new file mode 100644 index 0000000000..27a0d1d3c6 --- /dev/null +++ b/zh-cn/release-notes/changelogs/OpenHarmony_4.0.5.5/changelogs-arkui.md @@ -0,0 +1,45 @@ +# arkui子系统ChangeLog + +## cl.arkui.1 List组件和Gird组件滚动条默认状态变更 + +List组件和Gird组件滚动条默认状态从BarState.Off变更为BarState.Auto。 + +**变更影响** + +List组件和Gird组件,如果没有设置滚动条状态,变更前不会显示滚动条,变更以后滚动时会显示滚动条,滚动停止两秒后滚动条隐藏。 + +**关键接口/组件变更** + +List组件和Gird组件滚动条API接口文档: +- [List组件属性](../../../application-dev/reference/arkui-ts/ts-container-list.md#属性) +- [Grid组件属性](../../../application-dev/reference/arkui-ts/ts-container-grid.md#属性) + +**适配指导** + +对于不需要滚动条的场景,需要将List组件或Grid组件的scrollBar属性设置为BarState.Off。 + +参考代码如下: +```ts +// xxx.ets +@Entry +@Component +struct ListItemExample { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, item => item) + } + .width('90%') + .scrollBar(BarState.Off) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} +``` \ No newline at end of file -- GitLab