【问题标题】:ListView section data (react-native)ListView 部分数据(react-native)
【发布时间】:2015-04-01 02:59:12
【问题描述】:

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

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

谢谢

【问题讨论】:

    标签: ios listview react-native


    【解决方案1】:

    您可以找到 ListViewDataSource here 的源代码。

    cloneWithRows 方法定义为:

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

    而 cloneWithRowsAndSections 是:

    cloneWithRowsAndSections( 数据块:任何, sectionIdentities:?数组, 行标识:?数组> )

    sectionIdentities 参数记录为:

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

    【讨论】:

      猜你喜欢
      • 2019-02-11
      • 1970-01-01
      • 2016-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多