我正在获取产品列表,然后使用平面列表显示,我的列表包含5个项目,因为您可以看到由于不同的描述文本,平面列表行高度是可变的.所以问题是我的最后一项卡片不完全可见,这可能是某种平面列表问题或布局问题.任何帮助将受到高度赞赏
- renderProducts() {
- if (this.props.loading === true) {
- return (
- <View style={Styles.spinnerStyle}>
- <ActivityIndicator size='large' />
- </View>
- );
- }
- return (
- <FlatList
- data={this.props.myProducts}
- keyExtractor={(item) => item.id}
- renderItem={({ item }) => (
- <Card
- title={item.title}
- image={{
- uri: item.image !== null ? item.image.src :'../resImage.jpg'
- }}
- >
- <Text style={{ marginBottom: 10 }}>
- {item.body_html}
- </Text>
- <Button
- icon={{ name: 'code' }}
- backgroundColor='#03A9F4'
- fontFamily='Lato'
- buttonStyle={{ borderRadius: 0,marginLeft: 0,marginRight: 0,marginBottom: 0 }}
- title='VIEW NOW'
- />
- </Card>
- )}
- />
- );
- }
- render() {
- return (
- <View>
- <View style={Styles.viewStyle}>
- <Text style {Styles.textStyle}>ProductsList</Text>
- </View>
- {
- this.renderProducts()
- }
- </View>
- );
- }