From 37a12ef1fdb7fb864d9e91a8b15f22fa32d83475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=8B=A4=E6=B0=91?= Date: Fri, 11 Apr 2025 11:27:04 +0800 Subject: [PATCH] =?UTF-8?q?refactor(basic):=20=E4=BC=98=E5=8C=96=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E6=8F=90=E7=A4=BA=E6=96=87=E6=A1=88=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在弹窗提示中添加滚动功能,以支持长文本显示 - 设置最大高度限制,避免过长的提示文本导致界面变形 --- src/main/ets/utils/ToolsHelper.ets | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/main/ets/utils/ToolsHelper.ets b/src/main/ets/utils/ToolsHelper.ets index 271f51b..a804892 100644 --- a/src/main/ets/utils/ToolsHelper.ets +++ b/src/main/ets/utils/ToolsHelper.ets @@ -181,17 +181,22 @@ function alertDialogBuilder(options: AlertBean) { .alignItems(VerticalAlign.Top) .padding(9) - Text(options.options.msg) - .fontSize(14) - .fontWeight(FontWeight.Medium) - .fontColor($r('sys.color.black')) - .textAlign(TextAlign.Center) - .lineHeight(20) - .padding({ - left: 19, - right: 19 - }) - .width('100%') + Scroll(){ + Text(options.options.msg) + .fontSize(14) + .fontWeight(FontWeight.Medium) + .fontColor($r('sys.color.black')) + .textAlign(TextAlign.Center) + .lineHeight(20) + .padding({ + left: 19, + right: 19 + }) + .width('100%') + }.scrollable(ScrollDirection.Vertical) + .constraintSize({ + maxHeight: 220 + }) Text(options.options.confirm?.text ?? '确定') .fontSize(14) .fontWeight(FontWeight.Medium)