Ios React本机独立视图组件可与FlatList滚动?
有没有办法用平面列表滚动一个单独的组件Ios React本机独立视图组件可与FlatList滚动?,ios,react-native,react-native-ios,react-native-flatlist,Ios,React Native,React Native Ios,React Native Flatlist,有没有办法用平面列表滚动一个单独的组件 <View> <View> <Text>Some component outside of FlatList</Text> <Text>Porfile Information Above FlatList</Text> <Text>How to scroll with flatlist</Text> </View>
<View>
<View>
<Text>Some component outside of FlatList</Text>
<Text>Porfile Information Above FlatList</Text>
<Text>How to scroll with flatlist</Text>
</View>
<FlatList
data={DATA}
renderItem={({item}) => (
<View>
<Text>a bunch of list that will scroll</Text>
</View>
)}
/>
<View>
因此,如果渲染整个组件,平面列表上方会有一个部分,当只有平面列表是可滚动的时,它会留在那里
如何使顶部部分可以与平面列表一起滚动?您可以将组件放在平面列表提供的ListHeader组件道具中,如:
<View>
<View>
<Text>Some component outside of FlatList</Text>
<Text>Porfile Information Above FlatList</Text>
<Text>How to scroll with flatlist</Text>
</View>
<FlatList
data={DATA}
renderItem={({item}) => (
<View>
<Text>a bunch of list that will scroll</Text>
</View>
)}
/>
<View>
<FlatList
data={DATA}
renderItem={({ item }) => (
<View>
<Text>a bunch of list that will scroll</Text>
</View>
)}
ListHeaderComponent={
<View>
<Text>Some component outside of FlatList</Text>
<Text>Porfile Information Above FlatList</Text>
<Text>How to scroll with flatlist</Text>
</View>
}/>