From: Caisking <3449750381@qq.com> Date: Sat, 9 Nov 2024 13:26:38 +0000 (+0800) Subject: #1094 消息界面,上滑回不到初始位置 X-Git-Tag: fd230_release_V1.3.102~97^2~1^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=da6e913bbb2d26000762cefdf77c13b6b3276f64;p=mirrors%2FFD230.git #1094 消息界面,上滑回不到初始位置 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageShowView.h b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageShowView.h index 8d13f06f2..e566094a3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageShowView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageShowView.h @@ -53,6 +53,7 @@ namespace OHOS UILabelButtonExt *deleteButton{nullptr}; // 清除按键 UIImageView *background{nullptr}; + UIImageView *backgroundtop{nullptr}; bool viewInitStatus{false}; std::string titleStr; diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp index 83ac5e301..7971847ac 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowView.cpp @@ -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);