React Native ScrollView如何跳到顶部

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

猜你喜欢

转载自ipython.iteye.com/blog/2269144
今日推荐