J'utilise React Native Base pour mon application iPad et je suis en train de deux Col
composants à l'intérieur d'un composant Grid
comme ceci:colonne à l'intérieur de la grille prend une demi-largeur réagir-base native
<Container style={styles.container}>
<Header style={styles.header}>
<Body>
<Title>Header</Title>
</Body>
</Header>
<Content style={styles.mainContent}>
<Grid>
<Col style={styles.leftContent}>
</Col>
<Col style={styles.rightContent}>
</Col>
</Grid>
</Content>
</Container>
ma feuille de style est comme ceci:
const styles = StyleSheet.create({
container: {
backgroundColor: '#ccc'
},
mainContent: {
marginTop: 10,
},
header: {
backgroundColor: '#fff'
},
leftContent: {
width: 340,
height: 686,
backgroundColor: "green",
marginLeft: 5,
},
rightContent: {
width: 614,
height: 686,
backgroundColor: "yellow",
marginLeft: 10,
marginRight: 5,
},
Les deux Col
prennent presque la même largeur et non la largeur donnée. Comment devrais-je faire ces composants pour prendre la largeur donnée?
avez-vous essayé d'utiliser flex? –