From 9008b533ee2e8d5c00c45ea6cd612512a2593b81 Mon Sep 17 00:00:00 2001 From: Caisking Date: Wed, 20 Aug 2025 17:47:34 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E4=BA=A7=E6=B5=8B=E7=95=8C?= =?utf8?q?=E9=9D=A2=E7=9A=84=E6=BB=91=E5=8A=A8=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../UI/producttest/include/testQRCode.h | 1 + .../zhihui/UI/producttest/src/testQRCode.cpp | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/code/sdk/zhihui/UI/producttest/include/testQRCode.h b/code/sdk/zhihui/UI/producttest/include/testQRCode.h index fdebf6595..5d1cc1ff3 100644 --- a/code/sdk/zhihui/UI/producttest/include/testQRCode.h +++ b/code/sdk/zhihui/UI/producttest/include/testQRCode.h @@ -38,6 +38,7 @@ namespace OHOS bool initViewStatus{false}; UILabel *Title{nullptr}; // 标题 UIQrcode *QRCodeView{nullptr}; // 二维码视图 + UILabelButtonExt *labelButton_next{nullptr}; // 退出按钮 }; } diff --git a/code/sdk/zhihui/UI/producttest/src/testQRCode.cpp b/code/sdk/zhihui/UI/producttest/src/testQRCode.cpp index 7dbd7c684..d46ec4323 100644 --- a/code/sdk/zhihui/UI/producttest/src/testQRCode.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testQRCode.cpp @@ -12,6 +12,7 @@ #include "producttest/include/testQRCode.h" #include "producttest/include/testView.h" #include "producttest/include/testModel.h" +#include "producttest/include/testabout.h" #include "components/ui_qrcode.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" @@ -57,6 +58,11 @@ namespace OHOS delete QRCodeView; QRCodeView = nullptr; } + if (labelButton_next) + { + delete labelButton_next; + labelButton_next = nullptr; + } initViewStatus = false; } @@ -93,6 +99,15 @@ namespace OHOS testQRCodeScrollView->SetTouchable(true); testQRCodeScrollView->SetDraggable(true); + // 设置拖拽监听器,实现滑动退出功能 + UIView::OnDragListener *draglistener = static_cast(testPresenter::GetInstance()); + if (draglistener == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "testQRCodeView::draglistener can not be nullptr!"); + return false; + } + testQRCodeScrollView->SetOnDragListener(draglistener); + // 创建标题 Title = new UILabel(); if (Title == nullptr) @@ -130,6 +145,10 @@ namespace OHOS testQRCodeScrollView->Add(QRCodeView); + // 创建退出按钮 + // labelButton_next = testAboutView::GetInstance()->init_button_next(167, 378, Test_ViewMapper_t[id].viewid_str_next); + // testQRCodeScrollView->Add(labelButton_next); + return true; } -- 2.17.1