react-native - 如何在 React Native 0.63 中滚动到滚动视图的底部?
问题描述
如何使用 React Native 0.63 中的钩子滚动到任何列表的底部?当我做
const scrollviewref = useRef(ScrollView);
<ScrollView
ref={scrollviewref}
onContentSizeChange={scrollviewref
.getNode()
.scrollTo({ animated: true }, 0)}
>
它说 scrollviewref.getNode 不是函数或
<ScrollView
ref={scrollviewref}
onContentSizeChange={scrollviewref
.scrollTo({ animated: true }, 0)}
>
它说 scrollviewref.scrollTo 不是一个函数
我已经添加了
scrollviewref.current.scrollToEnd({ animated: true });
在 useEffect 但滚动没有立即发生,有什么建议吗?
有人可以帮我吗?任何线索都会很棒。
解决方案
推荐阅读
- c# - 从 UWP 应用使用 VLC-WinRT 流式传输 RTP
- arrays - Angular 7双向绑定:将数组作为参数的管道无法按预期工作
- c - 我的代码没有正确地从每个单独的单词中反转字符串?
- python - 如何使用 sys.stdout 返回任何对象
- jquery - 在列中搜索值,然后在匹配结果后过滤表
- c# - 无法在存储库构造函数 asp.net core 中创建服务范围
- powershell - 将空文件夹压缩为文件夹,而不是文件
- gcc - 如何在 Cortex-M 上的“noreturn”函数中重置堆栈指针?
- javascript - 如何在 vscode 扩展中使用正则表达式保留返回战车?
- java - Servlet 在 Eclipse 的运行时抛出异常