kirimi
kirimi

Reputation: 1400

react-native : horizontal scrollview won't work inside flatlist

I have a horizontal scrollview inside my flatlist but it won't scroll.

renderRow = ({ item }) => {   
 return (
  <View style={{width:'100%', backgroundColor:'transparent'}}>
 <ScrollView horizontal={true}>
  //I have multiple images here      
 </ScrollView>
 </View>

      )
    }

This is my flatlist

<FlatList
           keyExtractor={(item, index) => index.toString()}
           data={this.state.data}
           renderItem={this.renderRow}
         />

is it possible to put horizontal scrollview inside flatlist?

Upvotes: 0

Views: 88

Answers (2)

Idan
Idan

Reputation: 4023

You can try somethig like this:

<ScrollView horizontal={true} style={{flex: 1}}>
  //Place Mutiple image in ScrollView.    
 </ScrollView>

Upvotes: 0

CodeBanBan
CodeBanBan

Reputation: 48

Try to add style width:100% in ScrollView

<ScrollView horizontal={true} style={{width:'100%'}}>
  //I have multiple images here      
 </ScrollView>

Upvotes: 1

Related Questions