From b64e115025e1692f4ffc4cc2f5d611c7eaece8d4 Mon Sep 17 00:00:00 2001 From: ywcoder <1104410818@qq.com> Date: Fri, 5 Sep 2025 15:56:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry/src/main/ets/pages/SetDifferentAttributes.ets | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ArkUI/entry/src/main/ets/pages/SetDifferentAttributes.ets b/ArkUI/entry/src/main/ets/pages/SetDifferentAttributes.ets index ca4cfc1..2583e63 100644 --- a/ArkUI/entry/src/main/ets/pages/SetDifferentAttributes.ets +++ b/ArkUI/entry/src/main/ets/pages/SetDifferentAttributes.ets @@ -25,6 +25,7 @@ struct TestHeightPage { @State myHeight1: number = 30; @State myHeight2: number = 60; @State flag: Boolean = false + build() { Column() { Text(this.message) @@ -35,17 +36,11 @@ struct TestHeightPage { .backgroundColor(Color.Orange) Button('Modify Text attribute height').onClick(() => { - //1.if/else - if (this.flag) { - this.flag = false; - } else { - this.flag = true; - } - //2.取反 this.flag = !this.flag; }).margin({ top: 12 }) } .height('100%') } } + // [End set_different_attributes] \ No newline at end of file -- Gitee