I am new at developing React Native application. I want to align multiple(maybe three) React Native Element 'Tile' in a single row, something like 2X3 matrix style. I am trying to use flexbox but is not able to achieve the result. Here's my code:
import React, { Component } from 'react';
import { Text, View, TextInput, StyleSheet } from 'react-native';
import { Constants } from 'expo';
import { Tile } from 'react-native-elements';
export default class Tel extends Component {
render() {
return (
<View style={styles.tileStyle}>
<View style={{width: 20, height: 20,}}>
<Tile
featured
caption="Text"
/>
</View>
<View style={{width: 20, height: 20,}}>
<Tile
featured
caption="Some Caption Text"
/>
</View>
<View style={{width: 20, height: 20,}}>
<Tile
featured
caption="Some"
/>
</View>
<View style={{width: 20, height: 20,}}>
<Tile
featured
caption="Text"
/>
</View>
<View style={{width: 20, height: 20,}}>
<Tile
featured
caption="Some Caption Text"
/>
</View>
<View style={{width: 20, height: 20,}}>
<Tile
featured
caption="Some"
/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
tileStyle: {
flex: 1,
flexDirection: 'row',
// alignItems: 'center',
// justifyContent: 'center',
paddingTop: Constants.statusBarHeight,
backgroundColor: '#ecf0f1',
}
});
All I can get three tiles in column wise and no width or height of them. Please help out with the solution.
<Text>
replace it with<Tile>
and see – Aravind S