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