在NativeiOS中,您可以使用以下命令将UITableView滚动到特定的UITableViewCell:
[tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:87 inSection:0]
atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
Run Code Online (Sandbox Code Playgroud)
..或类似的.
例如,如果ListView持有100个项目,我想滚动使第87个项目可见.
看看React Native ListView文档,没有什么明显的.
有没有人设法实现这一目标?我意识到ListView没有包装UITableView所以我们不能只公开该方法.
编辑:看起来有一些支持这是在0.19-rc版本,检查这个https://github.com/facebook/react-native/releases
https://github.com/facebook/react-native/commit/33e05a11f00d1455f39b6dfef1c76c4130df02e5
使用ScrollViewwithcontentOffset={{ x: offsetX, y: offsetY }}并根据您要滚动到的行计算偏移变量。
| 归档时间: |
|
| 查看次数: |
6481 次 |
| 最近记录: |