解决设置中浏览特效界面息屏滑动监听失效问题
authorluozheng <1732036298@qq.com>
Wed, 21 Jan 2026 10:56:09 +0000 (18:56 +0800)
committerluozheng <1732036298@qq.com>
Wed, 21 Jan 2026 10:56:09 +0000 (18:56 +0800)
code/sdk/application/wearable/fd272/nativeapp/nativeui/set_dial_style/include/SetDialStyleView.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/set_dial_style/src/SetDialStyleView.cpp

index d0fc991..3a58ce3 100644 (file)
@@ -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]);