📌  相关文章
📜  反应原生滚动视图检测结束 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:39.247000             🧑  作者: Mango

代码示例2
import React from 'react';
import {ScrollView, Text} from 'react-native';

const isCloseToBottom = ({layoutMeasurement, contentOffset, contentSize}) => {
  const paddingToBottom = 20;
  return layoutMeasurement.height + contentOffset.y >=
    contentSize.height - paddingToBottom;
};

const MyCoolScrollViewComponent = ({enableSomeButton}) => (
   {
      if (isCloseToBottom(nativeEvent)) {
        enableSomeButton();
      }
    }}
    scrollEventThrottle={400}
  >
    Here is very long lorem ipsum or something...
  
);

export default MyCoolScrollViewComponent;