From c4f55367380103471811d28ea87bbe1cde72da41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=8B=A4=E6=B0=91?= Date: Mon, 2 Sep 2024 18:22:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=86=99=E7=AD=BE=E5=90=8D=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Index.ets | 4 ++++ src/main/ets/view/LoadingView.ets | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/main/ets/view/LoadingView.ets diff --git a/Index.ets b/Index.ets index 4e2a3a1..629f66d 100644 --- a/Index.ets +++ b/Index.ets @@ -39,3 +39,7 @@ export { XDialogController } from './src/main/ets/dialog/XDialogController' */ export { WindowHelper } from './src/main/ets/utils/WindowHelper' +/** + * 自定义view + */ +export { LoadingView } from './src/main/ets/view/LoadingView' diff --git a/src/main/ets/view/LoadingView.ets b/src/main/ets/view/LoadingView.ets new file mode 100644 index 0000000..03f9d14 --- /dev/null +++ b/src/main/ets/view/LoadingView.ets @@ -0,0 +1,30 @@ +@Preview +@Component +export struct LoadingView { + @Link isLoading: boolean + + @Builder + doNothingBuilder() { + } + + @BuilderParam customBuilderParam: () => void = this.doNothingBuilder + + build() { + Stack() { + this.customBuilderParam() + Column() { + LoadingProgress() + .color(Color.White) + .width(80).height(80) + Text('努力加载中..') + .fontSize(16) + .fontColor(Color.White) + } + .visibility(this.isLoading ? Visibility.Visible : Visibility.None) + .width('100%') + .height('100%') + .backgroundColor('#40000000') + .justifyContent(FlexAlign.Center) + } + } +} \ No newline at end of file