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;
}
/* DeInit:删除组件 */
void TraingRecordView::DeInit()
{
- UIView *view = static_cast<UIViewGroup *>(container_)->GetChildrenHead();
- while (view != nullptr)
+ if (label1_ != nullptr)
{
- UIView *tempView = view;
- view = view->GetNextSibling();
- if (tempView->GetParent())
- {
- static_cast<UIViewGroup *>(tempView->GetParent())->Remove(tempView);
- }
- delete tempView;
+ delete label1_;
+ label1_ = nullptr;
+ }
+ if (label2_ != nullptr)
+ {
+ delete label2_;
+ label2_ = nullptr;
}
delete container_;
container_ = nullptr;