简体   繁体   English

行id的React-native scrollToRow?

[英]React-native scrollToRow by row id?

如何滚动到ListView上的某一行?

you need to set a ref to your row inside your renderRow method. 你需要在renderRow方法中为你的行设置一个ref。 Then call this.refs.row.measure to get its xy coordinate. 然后调用this.refs.row.measure来获取其xy坐标。 After your component is mounted, you can use this.listview.scrollTo method to scroll to that row. 装入组件后,可以使用this.listview.scrollTo方法滚动到该行。 Hope this can help you. 希望这可以帮到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM