2
私は別のセクションヘッダーで複数のセクションをレンダリングするために使用しています。私はそれが私が望むようにそれを表示するいくつかの問題を抱えています。 グリッドとしてセクションの項目の上と下に私のヘッダーを持っていたいと思います。このコードでは本物の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"
}
});
だから私はsectionHeaderにsectionListContainerのCSSを適用しないことができるようにしたいと思います。しかし、私はそれが可能であるかどうかはわかりません。
誰かがそれについて考えているなら、私に教えてください!
ありがとうございます!
'renderSectionHeader'の内容を投稿できますか? [ここ](https://facebook.github.io/react-native/docs/sectionlist.html#examples)のように、ヘッダーとアイテムに別々のスタイル定義を使用することにはいくつか問題がありますか?投稿されたコードから、あなたはそれをしていないように見えます。 – NiFi