【问题标题】:In a SectionList how do i hide the section header of an empty section (data:[])在 SectionList 中,我如何隐藏空部分的部分标题(数据:[])
【发布时间】:2019-04-30 08:43:32
【问题描述】:

我正在使用 react-native 的 SectionList 并且无法隐藏我的数据集的空白部分的部分标题。我只想显示节标题和不为空的节的行。

【问题讨论】:

  • 您应该将@Andre Simon 的回答标记为已接受

标签: list react-native header sectionheader react-native-sectionlist


【解决方案1】:

这就是我所做的:

<SectionList
   renderSectionHeader={({ section }) => (
      section.data.length > 0 ? this._renderHeader(section.title) : (null)
   )}
   ...
/>

【讨论】:

    猜你喜欢
    • 2012-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-16
    • 1970-01-01
    相关资源
    最近更新 更多