javascript - React Native 中的偏移 RefreshControl
问题描述
编辑: React Native 中似乎有一个错误。我在 GitHub 上创建了一个错误。对于每个寻求解决方案的人:目前似乎没有。
https://github.com/facebook/react-native/issues/23988
––––</p>
我使用的是半透明标题,这就是为什么我用ScrollView
apaddingTop
来抵消内容。当我下拉刷新时,微调器仍在顶部。
我曾尝试使用contentInset={{ top: 80 }}
来抵消一切,但在 iOS 上存在一个问题,有时无法正确拾取并设置为0
.
还有其他方法可以让 RefreshControl 开始降低吗?
这是我的组件:
<Animated.ScrollView
scrollEventThrottle={1}
onScroll={Animated.event(
[{ nativeEvent: { contentOffset: { y: this.state.scrollY } } }],
{ useNativeDriver: true },
)}
contentInset={{ top: headerHeight() + 10 }}
>
解决方案
style
您是否为或设置了填充contentContainerStyle
?
您能否提供一些代码片段,您的 ScrollView 具有哪些属性以及包装的内容?
推荐阅读
- sonarqube - 在扫描期间跳过 SonarQube 传感器
- angular - 在 socket.io-client 中调用 IO 时出错,角度 8
- python - 一行键盘出错,另一行不出错
- node.js - 使用 node-pg 和 Express 创建交易?
- python - 使用 python 创建 hdf5 文件后,我遇到了 ValueError
- linux - 变量超出条件的 Bash
- sql - 修改报表范围sql查询只返回当年
- google-apps-script - Google 表格:使用命名范围查找所有单元格
- reactjs - 从不同的组件访问父元素?
- python - 如何模拟每个方法测试的类初始化程序?