如何在react-native中启动滚动到某个位置的listview [英] How to start listview scrolled to a certain position in react-native

查看:57
本文介绍了如何在react-native中启动滚动到某个位置的listview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试过initialOffset,调用refs.list.scrollTo(该错误表示未定义)但它们都不起作用,尽管它们在滚动视图中很好.

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.

如何做到这一点?

推荐答案

我想通了.this.refs.list.refs['listviewscroll'].scrollWithoutAnimationTo(vertical, horizo​​ntal)

可能还有其他更简单的方法,但这个方法适用于 react-native 0.10.0

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

这篇关于如何在react-native中启动滚动到某个位置的listview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆