0

I tried to make a flatlist of image, but each image should be above the others:

enter image description here

<FlatList
    style={styles.listAvatar}
    data={item.etudiants}
    keyExtractor={(item, index) => index.toString()}
    renderItem={({ item, index }) => <ItemAvatar urlAvatar={item.avatar} />}
    horizontal
/>
const ItemAvatar = ({urlAvatar}:any) => {
    return (
            <Image
                style={{ width: 35, height: 35, borderRadius: 100}}
                source={{uri: urlAvatar}}
            />
    )
}

enter image description here

So I tried to do something like that:

<Image
    style={{ width: 35, height: 35, borderRadius: 100, marginRight: -15}}
    source={{uri: urlAvatar}}
/>

But I got:

enter image description here

The last image is cut..

1 Answer 1

1

you can try this

<Image
    style={{
      width: 35,
      height: 35,
      borderRadius: 100,
      left: index * -15,
    }}
    source={{ uri: urlAvatar }}
/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.