如何使用本机反应识别元素是否在屏幕上?

How to recognize if element is on the screen using react native?

当用户在我的应用中滚动 post 时,我想识别用户现在看到的当前 post。

您可以从 contentOffset

获取滚动条上的 y 位置
<ScrollView
  ref={(s) => this.scrollview = s}
  onScroll={(event) => {console.log(event.nativeEvent.contentOffset.y)}}
  ...
></ScrollView>