Ios 将本机网格布局与节标题进行反应

Ios 将本机网格布局与节标题进行反应,ios,gridview,reactjs,react-native,Ios,Gridview,Reactjs,React Native,我实现了一个与此类似的卡片列表:,但是,它似乎使用 list: { justifyContent: "center", flexDirection: "row", flexWrap: "wrap", } 及 在中,样式不允许正确呈现节标题,并且它们会显著更改listview的布局 节标题呈现如下所示: <View style={styles.section}> <Text style={styles.sectionHeaderText}>----{sec

我实现了一个与此类似的卡片列表:,但是,它似乎使用

list: {
  justifyContent: "center",
  flexDirection: "row",
  flexWrap: "wrap",
}

在中,样式不允许正确呈现节标题,并且它们会显著更改listview的布局

节标题呈现如下所示:

<View style={styles.section}>
  <Text style={styles.sectionHeaderText}>----{sectionId}----</Text>
</View>

----{sectionId}----

我可以在没有节换行的情况下使用节标题,但是每行有一张卡不是一个选项。

与RN 0.35相同,节标题与列表元素内联呈现,没有分区。 见附图

列表代码:

     <ListView
      style={{
        flex: 1,
        alignSelf: 'stretch',
        margin: 10,
        marginBottom: 10,
        borderRadius: 6,
      }}
      dataSource={this.state.symbolsDataSource}
      renderRow={this.renderRow}
      contentContainerStyle={{
        alignItems: 'flex-start',
        flexDirection: 'row',
        flexWrap: 'wrap',
        overflow: 'hidden'
      }}
      enableEmptySections
      removeClippedSubviews
      showVerticalScrollIndicator
      keyboardDismissMode='on-drag'
      keyboardShouldPersistTaps
      renderFooter={() => <View style={{ height: 240 }}/>}
      initialListSize={30}
      renderSectionHeader={(sectionData, sectionID) =>
        <View style={{ justifyContent: 'center', backgroundColor: 'white'}}>
          <Text style={{ alignSelf: 'center',fontSize: fixFont(20), color: Colors.darkBlue }}>{sectionID}</Text>
        </View>
      }
      scrollRenderAheadDistance={400/*pixels*/}
      pageSize={4/*how many items to render each loop*/}

    />
}
initialListSize={30}
renderSectionHeader={(sectionData,sectionID)=>
{sectionID}
}
scrollRenderAheadDistance={400/*像素*/}
pageSize={4/*要呈现每个循环的项目数*/}
/>

与RN 0.35相同,节头与列表元素内联呈现,不分为节。 见附图

列表代码:

     <ListView
      style={{
        flex: 1,
        alignSelf: 'stretch',
        margin: 10,
        marginBottom: 10,
        borderRadius: 6,
      }}
      dataSource={this.state.symbolsDataSource}
      renderRow={this.renderRow}
      contentContainerStyle={{
        alignItems: 'flex-start',
        flexDirection: 'row',
        flexWrap: 'wrap',
        overflow: 'hidden'
      }}
      enableEmptySections
      removeClippedSubviews
      showVerticalScrollIndicator
      keyboardDismissMode='on-drag'
      keyboardShouldPersistTaps
      renderFooter={() => <View style={{ height: 240 }}/>}
      initialListSize={30}
      renderSectionHeader={(sectionData, sectionID) =>
        <View style={{ justifyContent: 'center', backgroundColor: 'white'}}>
          <Text style={{ alignSelf: 'center',fontSize: fixFont(20), color: Colors.darkBlue }}>{sectionID}</Text>
        </View>
      }
      scrollRenderAheadDistance={400/*pixels*/}
      pageSize={4/*how many items to render each loop*/}

    />
}
initialListSize={30}
renderSectionHeader={(sectionData,sectionID)=>
{sectionID}
}
scrollRenderAheadDistance={400/*像素*/}
pageSize={4/*要呈现每个循环的项目数*/}
/>