简体   繁体   English

VertScrollBox检测何时到达Android和IOS

[英]VertScrollBox Detect when bottom reached android and IOS

I have GridLayout1 on a VertScrollBox1 . 我在VertScrollBox1上有GridLayout1 The vertical scroll box scrolls through the content of the grid layout. 垂直滚动框滚动浏览网格布局的内容。 I need to detect when the Vertical scroll box reach the bottom so I get to load more content to the grid layout. 我需要检测“垂直”滚动框何时到达底部,以便将更多内容加载到网格布局中。 And do it again whenever bottom is reached again. 再次到达底部时再做一次。

How can I achieve this? 我该如何实现?

Use the OnViewportPositionChange() of the VertScrollBox1 . 使用OnViewportPositionChange()中的VertScrollBox1 Then some simple arithmetics tell you when you are at the bottom: 然后,一些简单的算术告诉您何时到达底部:

uses Math, ...;
// ...

procedure TForm1.VertScrollBox1ViewportPositionChange(Sender: TObject;
  const OldViewportPosition, NewViewportPosition: TPointF;
  const ContentSizeChanged: Boolean);
begin
  if CompareValue(NewViewportPosition.Y, GridLayout1.Height - VertScrollBox1.Height) = EqualsValue then
    Memo1.Lines.Add('At bottom, time to grow and load more content to the GridLayout');
end;

Since the values we compare are floats, use Math.CompareValue() for comparison. 由于我们比较的值是浮点数,因此请使用Math.CompareValue()进行比较。

Alternatively function SameValue() , also in the Math unit Math单元中也可以选择function SameValue()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 检测ListView何时到达底部 - onScroll()或onScrollStateChanged()? - Detect when ListView has reached the bottom - onScroll() or onScrollStateChanged()? 如何检测滚动条何时到达网页的顶部或底部? - How to detect when the scrollbar has reached the top or bottom of webpage? Android - 我怎么知道gridview何时到达底部? - Android - how can i know when gridview has reached the bottom? 检测scrollview是否到达底部钛 - detect if scrollview has reached the bottom titanium Android:如何检测 NestedScrollView 何时滚动到底部 - Android: How to detect when NestedScrollView scrolled to the bottom 如何检测滚动视图何时到达底部,以便可以向其中加载更多项目? - How can I detect when a scrollview has reached the bottom so that I can load more items into it? 到达底部时如何停止自动滚动? - How to stop auto scroll when it reached the bottom? 如何检测我的文档已到达移动设备的页面底部? - How to detect my document has reached the page bottom on mobile devices? 在iOS和Android应用程序附近检测信标 - Detect beacon when in the proximity, iOS & Android application Android ExpandableListView:如何检测滚动何时到达列表的底部/结尾 - Android ExpandableListView: how to detect when the scroll hits the bottom/end of list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM