React Native ScrollView How to Jump to the Top ?
页面中有个ScrollView,点击某个Button,跳到ScrollView的顶部。
可以参考以下例子:
<ScrollView ref={component => this._scrollView = component} />
//this._scrollView.scrollTo(0, 0); 这个有动画效果
this._scrollView.scrollWithoutAnimationTo(0,0); //这个没有动画效果
----
参考:http://stackoverflow.com/questions/29829375/how-to-scroll-to-bottom-in-react-native-listview
本文介绍如何在React Native中使用ScrollView组件并通过点击按钮使ScrollView返回到顶部位置的方法。提供了两种实现方式:一种带有滚动动画效果,另一种则没有动画直接滚动。
2万+

被折叠的 条评论
为什么被折叠?



