1

I'm showing items in list. I don't want to use horizontal scroll view but how can I wrap items such that they don't fall out of the screen? Just as we have FlowLayout in android.the picture shows the third item in first row is half out of the screen

<List  horizontal={true} 
                            scrollEnabled={false}
                            style={{flexWrap: "wrap"}}
                            dataArray={articleData.Types}
                              renderRow={(Type) =>
                                <ListItem style={{borderBottomWidth: 0}} content>
                                    <Button rounded>
                                    <Text>{Type.Name}</Text>
                                    </Button>
                                </ListItem>
                            }>
                            </List>
safina
  • 212
  • 2
  • 13

1 Answers1

1

Could use Views to achieve this:

<View style={styles.wrapContainer}>
    {DATA.map(data => {
      return (
        <View style={styles.buttonContainer} >
          <Button title={data.name}/>
        </View>
      )})
    }
  </View>

Working Example

TnR
  • 99
  • 4