From: Caisking <3449750381@qq.com> Date: Thu, 26 Sep 2024 12:15:45 +0000 (+0800) Subject: scrollview里面添加list,如果list item较少,滑动会有大片空白出现。 X-Git-Tag: release_V1.2.70_20241020_135402~357 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=2198f1faf2ebcf85545395ee534f2ee86f2edd33;p=mirrors%2FFD230.git scrollview里面添加list,如果list item较少,滑动会有大片空白出现。 --- diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp index 86db75298..324b922c7 100755 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp @@ -383,6 +383,9 @@ bool UIList::DragYInner(int16_t distance) if (childrenTail_->GetRelativeRect().GetBottom() < (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) { distance = 0; + } else if ((childrenTail_->GetRelativeRect().GetBottom() + distance) < + (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) { + distance = 0; } else if ((childrenTail_->GetRelativeRect().GetBottom() + distance) < (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) { distance = listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM) @@ -390,6 +393,25 @@ bool UIList::DragYInner(int16_t distance) } } } + // } else { + // if (childrenTail_ != nullptr) { + // if (isElastic_ && (reboundSize > 0) && + // (childrenTail_->GetRelativeRect().GetBottom() < + // (listHeight - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)))) { + // int16_t offset = (listHeight - scrollBlankSize_ - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)) + // - (childrenTail_->GetRelativeRect().GetBottom()); + // if (offset > reboundSize) { + // offset = reboundSize; + // } + // distance = CalculateElasticDragLen(reboundSize, offset, distance); + // } + // if ((childrenTail_->GetRelativeRect().GetBottom() + distance) < + // (listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM))) { + // distance = listHeight - scrollBlankSize_ - reboundSize - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM) + // - childrenTail_->GetRelativeRect().GetBottom(); + // } + // } + // } return MoveOffset(0, distance); }