简体   繁体   English

SectionList React-Native

[英]SectionList React-Native

As the natural property of sectionList Renders Header and a list of items in Heterogenous Listing: Eg: 作为sectionList Renders Header异构列表中项目列表的自然属性:例如:

<SectionList
  sections={[ // heterogeneous rendering between sections
    {data: [...], renderItem: ...},
    {data: [...], renderItem: ...},
    {data: [...], renderItem: ...},
  ]}
/>

How do i render SubHeaders Below Main Header and List the items of SubHeader as well as the MainHeader ? 如何在主标题下呈现SubHeader列出 SubHeader 的项目以及MainHeader

You can use ListHeaderComponent prop for your main header. 您可以将ListHeaderComponent属性用作主标题。 And you can use renderSectionHeader for your sections. 您可以为各部分使用renderSectionHeader。 And also just keep in mind if you don't want a sticky header stickySectionHeadersEnabled={false}. 而且,如果您不想使用粘性标头stickySectionHeadersEnabled = {false},也请记住。

https://facebook.github.io/react-native/docs/sectionlist.html#listheadercomponent https://facebook.github.io/react-native/docs/sectionlist.html#listheadercomponent

https://facebook.github.io/react-native/docs/sectionlist.html#rendersectionheader https://facebook.github.io/react-native/docs/sectionlist.html#rendersectionheader

https://facebook.github.io/react-native/docs/sectionlist.html#stickysectionheadersenabled https://facebook.github.io/react-native/docs/sectionlist.html#stickysectionheadersenabled

Hope this will solve your problems. 希望这能解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM