javascript - React Native 中的偏移 RefreshControl

标签 javascript react-native scrollview

编辑: React Native 似乎有一个错误。我在 GitHub 上创建了一个错误。求解答的各位:目前好像没有。

https://github.com/facebook/react-native/issues/23988

––––

我正在使用半透明标题,这就是为什么我给 ScrollView 一个 paddingTop 来偏移内容。当我下拉刷新时,微调器仍然在顶部。

我曾尝试使用 contentInset={{ top: 80 }} 来抵消所有内容,但在 iOS 上存在一个问题,有时无法正确拾取并设置为 0

是否有任何其他方法可以让 RefreshControl 开始降低?

enter image description here

这是我的组件:

  <Animated.ScrollView
    scrollEventThrottle={1}
    onScroll={Animated.event(
      [{ nativeEvent: { contentOffset: { y: this.state.scrollY } } }],
      { useNativeDriver: true },
    )}
    contentInset={{ top: headerHeight() + 10 }}
  >

最佳答案

您是否为 stylecontentContainerStyle 设置了填充?

您能否提供一些代码片段,您的 ScrollView 具有哪些属性以及由什么包裹?

关于javascript - React Native 中的偏移 RefreshControl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54934513/

相关文章:

javascript - 使用json数据动态生成图表

c# - 从网站更新 Windows 窗体应用程序 UI [屏幕抓取]

reactjs - React Native - 导入整个文件/将 js 代码拆分到多个文件中

objective-c - 如何判断 scrollView 是否即将向上或向下滚动

javascript - PHP- "template"

javascript - 如何从节点获取元素

react-native - 为什么使用this.setState会导致超出最大更新深度?

android - 让我们加密证书以使用 android api < 20

python - 忽略 ScrollView 中的滚动交互区域

显示滚动的 Android 弹出菜单