在NativeiOS您可以用做一個UITableView滾動到一個特定的UITableViewCell:陣營本地的ListView:如何滾動到一個特定的行
[tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:87 inSection:0]
atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
..或相似。
例如,如果ListView保存了100個項目,並且我想滾動以使第87個項目可見。
看着React Native ListView Docs沒有什麼明顯的。
有沒有人設法做到這一點?我意識到,ListView不會包裝UITableView,所以我們不能只公開該方法。
編輯:看起來像一些這方面的支持是0.19 RC版本,看看這個https://github.com/facebook/react-native/releases
https://github.com/facebook/react-native/commit/33e05a11f00d1455f39b6dfef1c76c4130df02e5
這看起來相關:http://stackoverflow.com/questions/33391040/how-to-start-listview-scrolled-to-a-certain-position-in-react-native?rq=1 –
不幸的是,支持你在'0.19.0-rc'中引用的只是手動訪問滾動響應器以滾動到特定**座標**的別名。我遇到同樣的問題,並進行相同的調查。目前需要計算偏移量並手動滾動到偏移量。 – Atticus