From: luozheng <1732036298@qq.com> Date: Wed, 21 Jan 2026 10:56:09 +0000 (+0800) Subject: 解决设置中浏览特效界面息屏滑动监听失效问题 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=8ae55a5c9ae6086e3c02776056e96a9c62cdd1a6;p=mirrors%2FFD230.git 解决设置中浏览特效界面息屏滑动监听失效问题 --- diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_dial_style/include/SetDialStyleView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_dial_style/include/SetDialStyleView.h index 4b3476cd8..c736bff27 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_dial_style/include/SetDialStyleView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_dial_style/include/SetDialStyleView.h @@ -26,6 +26,7 @@ namespace OHOS void OnClick(UIView &view); private: + UIViewGroup group; UILabelExt labelTitle_; UILabelExt labelCover_; diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_dial_style/src/SetDialStyleView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_dial_style/src/SetDialStyleView.cpp index d0fc99191..3a58ce382 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_dial_style/src/SetDialStyleView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/set_dial_style/src/SetDialStyleView.cpp @@ -15,15 +15,18 @@ namespace OHOS SetDialStyleView::~SetDialStyleView() { + group.RemoveAll(); } void SetDialStyleView::OnStart() { - GetRootContainer()->SetDraggable(true); - GetRootContainer()->SetTouchable(true); + group.SetPosition(0, 0, 466, 466); + group.SetDraggable(true); + group.SetTouchable(true); + AddViewToRootContainer(&group); if (PageTransitionMgr::GetInstance().GetTopSlideBackImage() == nullptr) { // support default slide back firstly - GetRootContainer()->SetOnDragListener(presenter_); + group.SetOnDragListener(presenter_); } @@ -31,7 +34,7 @@ namespace OHOS Cover_Image_.SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); Cover_Image_.SetStyle(STYLE_BACKGROUND_OPA, 0xff); Cover_Image_.SetStyle(STYLE_BORDER_RADIUS, 100); - AddViewToRootContainer(&Cover_Image_); + group.Add(&Cover_Image_); @@ -39,7 +42,7 @@ namespace OHOS Roller_Image_.SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); Roller_Image_.SetStyle(STYLE_BACKGROUND_OPA, 0xff); Roller_Image_.SetStyle(STYLE_BORDER_RADIUS, 100); - AddViewToRootContainer(&Roller_Image_); + group.Add(&Roller_Image_); labelTitle_.SetPosition(83, 50, 300, 60); labelTitle_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); @@ -48,24 +51,24 @@ namespace OHOS labelTitle_.SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); labelTitle_.SetRollSpeed(23); labelTitle_.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - AddViewToRootContainer(&labelTitle_); + group.Add(&labelTitle_); labelCover_.SetPosition(90, 153, 200, 60); labelCover_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); labelCover_.SetTextId(STR_OVERLAY_FLOW); - AddViewToRootContainer(&labelCover_); + group.Add(&labelCover_); labelRoller_.SetPosition(90, 273, 200, 60); labelRoller_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); labelRoller_.SetTextId(STR_ROLLER); - AddViewToRootContainer(&labelRoller_); + group.Add(&labelRoller_); btnCover_.SetPosition(298, 145, 100, 50); btnCover_.SetImages(PNG_TOGGLEBUTTON_ON_IMAGE, PNG_TOGGLEBUTTON_OFF_IMAGE); - AddViewToRootContainer(&btnCover_); + group.Add(&btnCover_); btnRoller_.SetPosition(298, 265, 100, 50); btnRoller_.SetImages(PNG_TOGGLEBUTTON_ON_IMAGE, PNG_TOGGLEBUTTON_OFF_IMAGE); - AddViewToRootContainer(&btnRoller_); + group.Add(&btnRoller_); const DialStyle style = SetDialStyleModel::GetInstance().GetStyle(); int len = sizeof(styleTable_) / sizeof(styleTable_[0]);