2

我想在 react-native 中创建一个两层(部分 >> 条目)列表视图,类似于 UIExplorerApp 中的 ListViewPagingExample,但使用 blob 数据/json 来填充部分信息。此外,我对将哪些参数值传递给 cloneWithRowsAndSections 感到困惑。

从文档( https://facebook.github.io/react-native/docs/listview.html#content )中找不到有关上述主题的任何内容,但仅提及它是可能的。一些例子会有所帮助。

谢谢

4

1 回答 1

1

您可以在此处找到 ListViewDataSource 的源代码。

cloneWithRows 方法定义为:

cloneWithRows(
    dataBlob: Array<any> | {[key: string]: any},
    rowIdentities: ?Array<string>
)

而 cloneWithRowsAndSections 是:

cloneWithRowsAndSections(dataBlob:任何,sectionIdentities:?Array,rowIdentities:?Array>)

sectionIdentities参数记录为:

这是部分标识符的数组。IE。['s1','s2',...]。如果未提供,则假定 dataBlob 的键是节标识。

于 2015-04-01T10:29:32.217 回答