未验证 提交 3891f273 编写于 作者: O openharmony_ci 提交者: Gitee

!749 Description:If the height of the child node is less than the height of...

!749 Description:If the height of the child node is less than the height of the parent node, the progress bar is not drawn
Merge pull request !749 from 施其昌/master
......@@ -385,9 +385,13 @@ void UIList::UpdateScrollBar()
auto allItemsRect = recycle_.GetAdapterItemsReletiveRect();
float totalHeight = allItemsRect.GetHeight() + 2.0f * scrollBlankSize_; // 2: two blank spaces on both sides
int16_t height = GetHeight();
yScrollBar_->SetForegroundProportion(height / totalHeight);
yScrollBar_->SetScrollProgress((scrollBlankSize_ - allItemsRect.GetTop()) /
if (totalHeight < height) {
return;
} else {
yScrollBar_->SetForegroundProportion(height / totalHeight);
yScrollBar_->SetScrollProgress((scrollBlankSize_ - allItemsRect.GetTop()) /
(totalHeight - height));
}
RefreshAnimator();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册