`
ipython
  • 浏览: 289094 次
  • 性别: Icon_minigender_1
  • 来自: 佛山
社区版块
存档分类
最新评论

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

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics