diff --git a/entry/src/main/cpp/function/src/IntegratingWithArkts.cpp b/entry/src/main/cpp/function/src/IntegratingWithArkts.cpp index 7741232233acaeecf89d2b0a08a4223eea9ec423..37704cd6497504a37c32ea401985868dab229787 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);