Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native - iOS Collection View

Which approach should I use in React Native where I need to implement a horizontal scroll like collection view? The look and feel are needed to be exactly similar to the native iOS UICollectionView.

like image 482
Pulkit Sharma Avatar asked Aug 23 '16 10:08

Pulkit Sharma


2 Answers

You can use both FlatList and ScrollView. You just need to style your list in a correct way, for example, something like this to create a grid. Check UIExplorer to see how basic components work.

like image 122
Radek Czemerys Avatar answered Nov 15 '22 03:11

Radek Czemerys


You can use the ListView component, make sure you set the horizontal property.

<ListView horizontal={true}
style={{flex:1}}
dataSource={this.state.dataSource}
renderRow={(data) => <Row/>}/>

Also, you can follow this link for reusable cells.

like image 30
KP_G Avatar answered Nov 15 '22 02:11

KP_G