2
我正在使用不同节标题呈现多个部分。我有些麻烦要以我想要的方式显示它。 我希望将我的标题放置在顶部和底部,作为网格的部分项目。React native SectionList布局
有了这个代码:
<SectionList
contentContainerStyle={styles.sectionListContainer}
renderItem={this.renderItem}
keyExtractor={this.getKey}
renderSectionHeader={this.renderSectionHeader}
shouldItemUpdate={this.shouldItemUpdate}
sections={[
{ data: mostViewedArray, key: "most_viewed", title: "Most viewed" },
{ data: recentlyArray, key: "recently", title: "Recently" }
]}
/>
const styles = StyleSheet.create({
sectionListContainer: {
flex: 1,
flexDirection: "row",
flexWrap: "wrap",
justifyContent: "space-between"
}
});
所以我希望能够sectionListContainer的CSS不适用于sectionHeader。但我不确定这是可能的。
如果有人有任何想法,请告诉我!
谢谢!
你可以发布'renderSectionHeader'的内容吗?对于标题和项目使用单独的样式定义是否存在一些问题(在这里)(https://facebook.github.io/react-native/docs/sectionlist.html#examples)?从发布的代码看来,你并没有这样做。 – NiFi