【发布时间】:2018-07-23 15:34:33
【问题描述】:
我有一个 FlatList 如下。我无法使内容可滚动,因此,我为视图添加了一种样式为 flex=1。
在视图中添加样式后,FlatList 根本不可见。
任何帮助将不胜感激
<View style={{ flex: 1 }}>
<FlatList
data={this.state.data}
// style={{ flex: 1 }}
onScroll={this.handleScroll}
ref='flatlist1'
showsVerticalScrollIndicator
onEndReachedThreshold={0.05}
ItemSeparatorComponent={this.FlatListItemSeparator}
renderItem={({ item, index }) => (
<View key={index} style={{ backgroundColor: index % 2 === 0 ? 'white' : '#f1f1f1' }}>
<Text style={styles.text}>
{item.playername}</Text>
<Text style={styles.text1}>{item.score}</Text>
</View>
)
}
keyExtractor={(item, index) => index.toString()}
/>
</View>
【问题讨论】:
标签: reactjs react-native react-redux reactive-programming react-native-flatlist