Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start listview scrolled to a certain position in react-native

Tags:

react-native

I've tried initialOffset, calling refs.list.scrollTo (which error says is undefined)but none of them work, although they are just fine in scrollview.

How can this be done?

like image 663
Zygro Avatar asked Oct 30 '22 16:10

Zygro


1 Answers

I figured it out. It's possible with this.refs.list.refs['listviewscroll'].scrollWithoutAnimationTo(vertical, horizontal)

there may be some other, easier way but this one works fine for react-native 0.10.0

like image 184
Zygro Avatar answered Nov 03 '22 00:11

Zygro