有没有人有更详细的SectionLists异构渲染示例?
<SectionList
sections={[ // heterogeneous rendering between sections
{data: [...], key: ..., renderItem: ...},
{data: [...], key: ..., renderItem: ...},
{data: [...], key: ..., renderItem: ...},
]}
/>非常感谢您的帮助!
发布于 2017-07-25 21:29:33
下面是我如何为SectionLists实现异构呈现的示例片段
这就是我的sectionsData数组
const sectionsData = { key: 'On Air', data: onAirShows, renderItem: ({item}) => <View><Text>{item}</Text></View> //This is what you want this particular section to look like }, { key: 'Off Air', data: offAirShows, renderItem: this._renderOffAirItems //Same thing for here. You can define it as a helper method and call it here like so }
<SectionList data={sectionsData} />
注意:onAirShows和offAirShows是一个数组
https://stackoverflow.com/questions/44782268
复制相似问题