From a003fdf6dd0002a089aa10d60cfa4c643d5b506d Mon Sep 17 00:00:00 2001 From: kangliang <2352009235@qq.com> Date: Mon, 22 Sep 2025 10:04:01 +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/cpp/function/src/IntegratingWithArkts.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entry/src/main/cpp/function/src/IntegratingWithArkts.cpp b/entry/src/main/cpp/function/src/IntegratingWithArkts.cpp index 7741232..37704cd 100644 --- a/entry/src/main/cpp/function/src/IntegratingWithArkts.cpp +++ b/entry/src/main/cpp/function/src/IntegratingWithArkts.cpp @@ -51,13 +51,13 @@ std::shared_ptr CreateButtonExample() // [StartExclude button_api] textNode->SetFontSize(TEXT_FONTSIZE); textNode->SetPercentWidth(1); - textNode->SetHeight(50); + textNode->SetHeight(40); textNode->SetTextAlign(ARKUI_TEXT_ALIGNMENT_CENTER); // [EndExclude button_api] // Regarding the proprietary interfaces of HarmonyOS, specifically the interfaces marked as since M.F.S(N). // Compatibility judgment, the value corresponding to version 5.1.1(19) is 50101, // which is derived from the new interface's since field 5*10000 + 1*100 + 1. - if (OH_GetSdkApiVersion() >= 19) { + if (OH_GetDistributionOSApiVersion() >= 50101) { textNode->SetButtonType(ARKUI_BUTTON_ROUNDED_RECTANGLE); } else { textNode->SetButtonType(ARKUI_BUTTON_TYPE_CAPSULE); -- Gitee