2015-04-01 86 views
1

我想在react-native中創建一個兩層(部分>>條目)listview,類似於來自UIExplorerApp的ListViewPagingExample,但使用blob data/json來填充節信息。另外,我對傳遞給cloneWithRowsAndSections的參數值感到困惑。ListView部分數據(react-native)

從文檔(https://facebook.github.io/react-native/docs/listview.html#content)中找不到關於上述主題的任何內容,但僅提及它是可能的。一些例子會有幫助。

謝謝

回答

1

你可以找到ListViewDataSource here的源代碼。

的cloneWithRows方法被定義爲:

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

鑑於cloneWithRowsAndSections是:

cloneWithRowsAndSections( dataBlob:任何, sectionIdentities:陣列, rowIdentities:陣列> )

sectionIdentities參數記錄爲:

這是段的標識符數組。即。 ['s1','s2',...]。 如果未提供,則假定dataBlob的密鑰是 節標識。