From 5c13d3e7dc9e0d310c8e7d65e563f9f1eceb0c19 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Tue, 19 Mar 2024 20:52:08 +0800 Subject: [PATCH] =?utf8?q?=E7=9B=AE=E5=89=8D=E8=AE=AD=E7=BB=83UI=E8=BF=98?= =?utf8?q?=E6=9C=89=E9=83=A8=E5=88=86bug=EF=BC=8C=E5=90=8E=E7=BB=AD?= =?utf8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/traing/src/TraingDataPresenter.cpp | 4 ++++ .../traing/src/TraingEnddataPresenter.cpp | 3 +-- .../traingrecord/src/TraingRecordView.cpp | 17 ++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataPresenter.cpp index 6078f2cfa..d55dc6c31 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataPresenter.cpp @@ -71,6 +71,10 @@ namespace OHOS { NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSTRONG); } + if (strcmp(view.GetViewId(), BUTTONNOTE) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSTRONG); + } return true; } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataPresenter.cpp index f469d6de9..8d5d8c199 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataPresenter.cpp @@ -68,11 +68,10 @@ namespace OHOS bool TraingEnddataPresenter::OnClick(UIView &view, const ClickEvent &event) { - // 根据控件id查找是哪个控件触发了点击回调 if (strcmp(view.GetViewId(), BUTTONBACK) == 0) { - //NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING); + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING); } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp index 169885ef8..6a3fe240b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp @@ -172,16 +172,15 @@ namespace OHOS /* DeInit:删除组件 */ void TraingRecordView::DeInit() { - UIView *view = static_cast(container_)->GetChildrenHead(); - while (view != nullptr) + if (label1_ != nullptr) { - UIView *tempView = view; - view = view->GetNextSibling(); - if (tempView->GetParent()) - { - static_cast(tempView->GetParent())->Remove(tempView); - } - delete tempView; + delete label1_; + label1_ = nullptr; + } + if (label2_ != nullptr) + { + delete label2_; + label2_ = nullptr; } delete container_; container_ = nullptr; -- 2.17.1