#1094 消息界面,上滑回不到初始位置
authorCaisking <3449750381@qq.com>
Sat, 9 Nov 2024 13:26:38 +0000 (21:26 +0800)
committerCaisking <3449750381@qq.com>
Sat, 9 Nov 2024 13:26:38 +0000 (21:26 +0800)
code/sdk/application/wearable/fd230app/nativeui/message/include/MessageShowView.h
code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp

index 8d13f06..e566094 100644 (file)
@@ -53,6 +53,7 @@ namespace OHOS
         UILabelButtonExt *deleteButton{nullptr}; // 清除按键
 
         UIImageView *background{nullptr};
+        UIImageView *backgroundtop{nullptr};
 
         bool viewInitStatus{false};
         std::string titleStr;
index 83ac5e3..7971847 100644 (file)
@@ -85,6 +85,9 @@ namespace OHOS
 
         delete background;
         background = nullptr;
+
+        delete backgroundtop;
+        backgroundtop = nullptr;
     }
 
     void MessageShowView::InitializeLabel(UILabel *label, int posX, int posY, int width, int height, const char *viewId, int fontSize)
@@ -155,6 +158,11 @@ namespace OHOS
     void MessageShowView::InitView()
     {
         /* -------------------------------------------------------------------------- */
+
+        CreateLine(backgroundtop, 0, 0, 100, 60, "line");
+        backgroundtop->SetVisible(false);
+        container_->Add(backgroundtop);
+        
         title = new UILabel();
         if (title == nullptr)
         {
@@ -251,10 +259,10 @@ namespace OHOS
         }
         container_->SetPosition(0, 0);
         container_->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION);
-        container_->SetScrollBlankSize(20);
-        container_->SetReboundSize(50);
-        // container_->SetHorizontalScrollState(false); // 设置水平滚动失效
-        // container_->SetDirection(1);
+        // container_->SetScrollBlankSize(20);
+        // container_->SetReboundSize(50);
+        container_->SetHorizontalScrollState(false); // 设置水平滚动失效
+        container_->SetDirection(1);
 
         container_->SetOnDragListener(presenter_);
         container_->SetTouchable(true);