score:101
Accepted answer
It is possible if you use percentage values for the widths:
<View style={styles.container}>
<View style={styles.item}>
...
</View>
</View>
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
flexWrap: 'wrap',
alignItems: 'flex-start' // if you want to fill rows left to right
},
item: {
width: '50%' // is 50% of container width
}
})
score:1
you can try scrollview with flatlist. the code below generates 2 columns. if you want 3 columns change numcolumn={data.length/3} etc.
<ScrollView
horizontal
showsVerticalScrollIndicator={false}
showsHorizontalScrollIndicator={false}
contentContainerStyle={{
flexDirection: 'row',
flexWrap: 'wrap',
}}>
<FlatList
data={data}
renderItem={this.renderItem}
keyExtractor={item => `${item.id}`}
showsHorizontalScrollIndicator={false}
numColumns={data.length / 2}
/>
</ScrollView>
Source: stackoverflow.com
Related Query
- 2 column layout with flexBox on React Native
- Create Layout with absolute Values and Flexbox in React Native
- React native two column layout for dynamic elements not working
- React Native Listview grid layout with Listview elements that align and append independently
- Text outside container with Flexbox and React native
- iOS Adaptive Layout with React Native
- React native flex layout with VictoryChart, Chart fit the parent container
- problem with RTL layout in react native project only when i release apk
- Aligning items with flexbox in react native
- Alignt TouchableOpacity with flexbox in react native
- Flexible layout with fixed-width and available space in React Native
- React Native Flex Layout With Absolute Size
- Layout issues with React Native
- Aligning with flexbox in react native
- React layout with flexbox
- React Native Grid Layout with section headers
- Two column grid in react native flexbox
- Flexbox layout react native - first view occupies entire screen
- Keyboard and layout handling with React Native
- 'grid' layout with forms in react native
- Flexbox styling with React Native
- Issue with Flexbox content in Row, for React Native
- float right in react native with flexbox
- Multiple flexbox row with multiple scrollview in react native
- Issues with Flexbox in React Native not displaying the Full Text
- React Native - Horizontal Flatlist with column wrapper doesn't take flex properly as required?
- facing problems with styling on react native and achieving a better responsive layout
- 100% width in React Native Flexbox
- Using an authorization header with Fetch in React Native
- React Native Border Radius with background color
More Query from same tag
- React Navigation only sets param after navigating a second time
- Uncaught (in promise) TypeError: res.map is not a function
- ReactNative this value returns different in ListView's renderRow
- Using Strophe.js with ReactNative
- REACT - useContext state sharing sync issue
- Send push notifications via AWS Pinpoint to specified User
- Update user location to server when application is in background
- React native dynamic themes through json data
- Display nested Json array fetched data React native
- How calulate the area of a polygon in react-native-maps?
- Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client?
- React Native / Swift - In App Purchases code crashing randomly in sandbox and testflight
- How to correctly update data in reactjs?
- I can't get any result or errors when i'm drawing signatures on expo app
- How to make foreach statement from array in RN
- How to use nested flatlist or sectionlist?
- React Native Can't nest View Inside Text
- How to log the AWS Amplify API.get request to view queryStringParameters on url
- Local Storage some time return undefined in react-native
- extract object from array - typescript
- How to render a new component after successfull login using React
- React Native: How to convert date format?
- Dispatch action to redux from react-native-router-flux event
- how to create form with several inputs without repetition - react-native?
- Detect system language change in react native
- class must either be declared abstract or implement abstract method called createJSModules in ReactPackage
- Where to Set EXPO_DEBUG value in ReactNative app?
- Upload images to firebase from ReactNative
- How to display Image from Firebase storage in React-native?
- Cannot render View with position absolute on Android with react-native